robin/laufey

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

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

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