-- 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')