neovim

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

print_commands_spec.lua (910B)


      1 local t = require('test.testutil')
      2 local n = require('test.functional.testnvim')()
      3 local Screen = require('test.functional.ui.screen')
      4 
      5 local clear, eq, command, fn = n.clear, t.eq, n.command, n.fn
      6 local assert_alive = n.assert_alive
      7 
      8 describe(':z^', function()
      9  before_each(clear)
     10 
     11  it('correctly sets the cursor after :z^', function()
     12    command('z^')
     13    eq(1, fn.line('.'))
     14  end)
     15 end)
     16 
     17 describe(':print', function()
     18  before_each(clear)
     19 
     20  it('does not crash when printing 0xFF byte #34044', function()
     21    local screen = Screen.new()
     22    -- Needs raw 0xFF byte, not 0xFF char
     23    command('call setline(1, "foo\\xFFbar")')
     24    command('%print')
     25    screen:expect([[
     26      ^foo{18:<ff>}bar                                           |
     27      {1:~                                                    }|*12
     28      fooÿbar                                              |
     29    ]])
     30    assert_alive()
     31  end)
     32 end)