neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

debug_spec.lua (2781B)


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