diff options
Diffstat (limited to 'test/functional/plugin/shada_spec.lua')
-rw-r--r-- | test/functional/plugin/shada_spec.lua | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/test/functional/plugin/shada_spec.lua b/test/functional/plugin/shada_spec.lua index b543037ae2..dbc78e63f0 100644 --- a/test/functional/plugin/shada_spec.lua +++ b/test/functional/plugin/shada_spec.lua @@ -179,6 +179,7 @@ describe('In autoload/shada.vim', function() ' + n name \'@\'', ' + rc contents ["abc", "def"]', ' + rt type CHARACTERWISE', + ' + ru is_unnamed FALSE', ' + rw block width 10', ' + sb search backward TRUE', ' + sc smartcase value FALSE', @@ -204,6 +205,7 @@ describe('In autoload/shada.vim', function() 'rt': 0, 'rw': 10, 'rc': ['abc', 'def'], + 'ru': {'_TYPE': v:msgpack_types.boolean, '_VAL': 0}, 'n': 0x40, 'l': 10, 'c': 0, @@ -226,6 +228,8 @@ describe('In autoload/shada.vim', function() .. '0 (CHARACTERWISE), 1 (LINEWISE), 2 (BLOCKWISE)', ' + rt type 10', ' # Expected boolean', + ' + ru is_unnamed 10', + ' # Expected boolean', ' + sc smartcase value NIL', ' # Expected boolean', ' + sm magic value "TRUE"', @@ -240,6 +244,7 @@ describe('In autoload/shada.vim', function() 'sp': {'_TYPE': v:msgpack_types.string, '_VAL': ["abc"]}, 'rt': 10, 'rc': '10', + 'ru': 10, 'n': -0x40, 'l': -10, 'c': 'abc', @@ -636,6 +641,7 @@ describe('In autoload/shada.vim', function() ' # Required key missing: rc', ' + rw block width 0', ' + rt type CHARACTERWISE', + ' + ru is_unnamed FALSE', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { }}] ]]):gsub('\n', '')) sd2strings_eq({ @@ -645,6 +651,7 @@ describe('In autoload/shada.vim', function() ' # Required key missing: rc', ' + rw block width 0', ' + rt type CHARACTERWISE', + ' + ru is_unnamed FALSE', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, }}] ]]):gsub('\n', '')) @@ -655,9 +662,11 @@ describe('In autoload/shada.vim', function() ' + rc contents ["abc", "def"]', ' + rw block width 0', ' + rt type CHARACTERWISE', + ' + ru is_unnamed FALSE', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, 'rc': ["abc", "def"], + 'ru': {'_TYPE': v:msgpack_types.boolean, '_VAL': 0}, }}] ]]):gsub('\n', '')) sd2strings_eq({ 'Register with timestamp ' .. epoch .. ':', @@ -668,9 +677,11 @@ describe('In autoload/shada.vim', function() ' | - "abcdefghijklmnopqrstuvwxyz"', ' + rw block width 0', ' + rt type CHARACTERWISE', + ' + ru is_unnamed TRUE', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, 'rc': ['abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'], + 'ru': {'_TYPE': v:msgpack_types.boolean, '_VAL': 1}, }}] ]]):gsub('\n', '')) sd2strings_eq({ 'Register with timestamp ' .. epoch .. ':', @@ -681,6 +692,7 @@ describe('In autoload/shada.vim', function() ' | - "abcdefghijklmnopqrstuvwxyz"', ' + rw block width 0', ' + rt type CHARACTERWISE', + ' + ru is_unnamed FALSE', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, 'rc': ['abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'], @@ -696,6 +708,7 @@ describe('In autoload/shada.vim', function() ' | - "abcdefghijklmnopqrstuvwxyz"', ' + rw block width 5', ' + rt type LINEWISE', + ' + ru is_unnamed FALSE', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, 'rc': ['abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'], @@ -712,11 +725,14 @@ describe('In autoload/shada.vim', function() ' # Expected integer', ' + rw block width ""', ' + rt type BLOCKWISE', + ' # Expected boolean', + ' + ru is_unnamed ""', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, 'rc': ['abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'], 'rw': "", 'rt': 2, + 'ru': "" }}] ]]):gsub('\n', '')) sd2strings_eq({ 'Register with timestamp ' .. epoch .. ':', @@ -729,11 +745,32 @@ describe('In autoload/shada.vim', function() ' # Unexpected enum value: expected one of 0 (CHARACTERWISE), ' .. '1 (LINEWISE), 2 (BLOCKWISE)', ' + rt type 10', + ' # Expected boolean', + ' + ru is_unnamed ["abc", "def"]', }, ([[ [{'type': 5, 'timestamp': 0, 'data': { 'n': 0x20, 'rc': 0, 'rw': -1, 'rt': 10, + 'ru': ['abc', 'def'], + }}] ]]):gsub('\n', '')) + sd2strings_eq({ + 'Register with timestamp ' .. epoch .. ':', + ' % Key Description Value', + ' + n name \' \'', + ' + rc contents @', + ' | - "abcdefghijklmnopqrstuvwxyz"', + ' | - "abcdefghijklmnopqrstuvwxyz"', + ' + rw block width 5', + ' + rt type LINEWISE', + ' # Expected boolean', + ' + ru is_unnamed 0', + }, ([[ [{'type': 5, 'timestamp': 0, 'data': { + 'n': 0x20, + 'rc': ['abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwxyz'], + 'rw': 5, + 'rt': 1, + 'ru': 0, }}] ]]):gsub('\n', '')) end) @@ -2039,13 +2076,14 @@ describe('In autoload/shada.vim', function() end it('works', function() + local version = nvim('get_vvar', 'version') getbstrings_eq({{timestamp='current', type=1, value={ generator='shada.vim', - version=704, + version=version, }}}, {}) getbstrings_eq({ {timestamp='current', type=1, value={ - generator='shada.vim', version=704 + generator='shada.vim', version=version }}, {timestamp=0, type=1, value={generator='test'}} }, { @@ -2056,11 +2094,11 @@ describe('In autoload/shada.vim', function() nvim('set_var', 'shada#add_own_header', 1) getbstrings_eq({{timestamp='current', type=1, value={ generator='shada.vim', - version=704, + version=version, }}}, {}) getbstrings_eq({ {timestamp='current', type=1, value={ - generator='shada.vim', version=704 + generator='shada.vim', version=version }}, {timestamp=0, type=1, value={generator='test'}} }, { |