robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
2.8 KiB89 linesraw
1local n = require('test.functional.testnvim')()
2local t = require('test.testutil')
3local Screen = require('test.functional.ui.screen')
4
5local describe, it, before_each = t.describe, t.it, t.before_each
6local feed = n.feed
7local clear = n.clear
8
9describe(':debug', function()
10  local screen
11  before_each(function()
12    clear()
13    screen = Screen.new(30, 14)
14    screen:set_default_attr_ids({
15      [1] = { bold = true, foreground = Screen.colors.Blue1 },
16      [2] = { bold = true, reverse = true },
17      [3] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
18      [4] = { bold = true, foreground = Screen.colors.SeaGreen4 },
19    })
20  end)
21  it('scrolls messages correctly', function()
22    feed(':echoerr bork<cr>')
23    screen:expect([[
24                                    |
25      {1:~                             }|*8
26      {2:                              }|
27      {3:E121: Undefined variable: bork}|
28                                    |
29      {4:Press ENTER or type command to}|
30      {4: continue}^                     |
31    ]])
32
33    feed(':debug echo "aa"| echo "bb"<cr>')
34    screen:expect([[
35                                    |
36      {1:~                             }|*5
37      {2:                              }|
38      {3:E121: Undefined variable: bork}|
39                                    |
40      {4:Press ENTER or type command to}|
41      Entering Debug mode.  Type "co|
42      nt" to continue.              |
43      cmd: echo "aa"| echo "bb"     |
44      >^                             |
45    ]])
46
47    feed('step<cr>')
48    screen:expect([[
49                                    |
50      {1:~                             }|*2
51      {2:                              }|
52      {3:E121: Undefined variable: bork}|
53                                    |
54      {4:Press ENTER or type command to}|
55      Entering Debug mode.  Type "co|
56      nt" to continue.              |
57      cmd: echo "aa"| echo "bb"     |
58      >step                         |
59      aa                            |
60      cmd: echo "bb"                |
61      >^                             |
62    ]])
63
64    feed('step<cr>')
65    screen:expect([[
66      {2:                              }|
67      {3:E121: Undefined variable: bork}|
68                                    |
69      {4:Press ENTER or type command to}|
70      Entering Debug mode.  Type "co|
71      nt" to continue.              |
72      cmd: echo "aa"| echo "bb"     |
73      >step                         |
74      aa                            |
75      cmd: echo "bb"                |
76      >step                         |
77      bb                            |
78      {4:Press ENTER or type command to}|
79      {4: continue}^                     |
80    ]])
81
82    feed('<cr>')
83    screen:expect([[
84      ^                              |
85      {1:~                             }|*12
86                                    |
87    ]])
88  end)
89end)