robin/laufey

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

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
934 B29 linesraw
1local t = require('test.testutil')
2local n = require('test.functional.testnvim')()
3
4local describe, it, before_each = t.describe, t.it, t.before_each
5local eq = t.eq
6local eval = n.eval
7local clear = n.clear
8local fn = n.fn
9local testprg = n.testprg
10
11describe('xxd', function()
12  before_each(clear)
13
14  it('works', function()
15    t.skip(t.is_arch('s390x'), 'FIXME: xxd not built correctly on s390x with QEMU?')
16    -- Round-trip test: encode then decode should return original
17    local input = 'hello'
18    local encoded = fn.system({ testprg('xxd') }, input)
19    local decoded = fn.system({ testprg('xxd'), '-r' }, encoded)
20    eq(input, decoded)
21  end)
22
23  it('handles long lines in revert mode', function()
24    t.skip(t.is_arch('s390x'), 'FIXME: xxd not built correctly on s390x with QEMU?')
25    local long_line = ('4'):rep(512) .. '\n'
26    fn.system({ testprg('xxd'), '-r' }, long_line)
27    eq(0, eval('v:shell_error'))
28  end)
29end)