blob: 7da2bf7394fa322d8220eb2af818a94ac7b24747 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
-- Can be run under Neovim with: nvim --headless -u NONE -l tests/storage_spec.lua
vim.opt.rtp:prepend(vim.fn.getcwd())
local s = require('extregs.storage')
local reg = { lines = { 'one', 'two' }, type = 'V', size = 2 }
local got = s.decode(s.encode(reg))
assert(vim.deep_equal(got, reg))
assert(vim.deep_equal(s.decode('hello'), { lines = { 'hello' }, type = 'v' }))
assert(vim.deep_equal(s.decode('hello\nworld\n'), { lines = { 'hello', 'world' }, type = 'V' }))
print('storage tests passed')
|