File: xxd_spec.lua

package info (click to toggle)
neovim 0.11.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64,320 kB
  • sloc: ansic: 264,714; python: 1,472; lisp: 1,237; sh: 1,137; makefile: 383; xml: 85; ruby: 6
file content (19 lines) | stat: -rw-r--r-- 488 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local t = require('test.testutil')
local n = require('test.functional.testnvim')()

local eq = t.eq
local clear = n.clear
local fn = n.fn
local testprg = n.testprg

describe('xxd', function()
  before_each(clear)

  it('works', function()
    -- Round-trip test: encode then decode should return original
    local input = 'hello'
    local encoded = fn.system({ testprg('xxd') }, input)
    local decoded = fn.system({ testprg('xxd'), '-r' }, encoded)
    eq(input, decoded)
  end)
end)