diff options
Diffstat (limited to 'test/functional/legacy')
-rw-r--r-- | test/functional/legacy/assert_spec.lua | 12 | ||||
-rw-r--r-- | test/functional/legacy/backspace_opt_spec.lua | 67 | ||||
-rw-r--r-- | test/functional/legacy/memory_usage_spec.lua | 46 |
3 files changed, 29 insertions, 96 deletions
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua index d48b8882af..515d6d91b8 100644 --- a/test/functional/legacy/assert_spec.lua +++ b/test/functional/legacy/assert_spec.lua @@ -242,9 +242,9 @@ describe('assert function:', function() -- assert_fails({cmd}, [, {error}]) describe('assert_fails', function() it('should change v:errors when error does not match v:errmsg', function() - eq(1, eval([[assert_fails('xxx', {})]])) - command([[call assert_match("Expected {} but got 'E731:", v:errors[0])]]) - expected_errors({"Expected {} but got 'E731: using Dictionary as a String'"}) + eq(1, eval([[assert_fails('xxx', 'E12345')]])) + command([[call assert_match("Expected 'E12345' but got 'E492:", v:errors[0])]]) + expected_errors({"Expected 'E12345' but got 'E492: Not an editor command: xxx': xxx"}) end) it('should not change v:errors when cmd errors', function() @@ -258,9 +258,9 @@ describe('assert function:', function() end) it('can specify and get a message about what failed', function() - eq(1, eval([[assert_fails('xxx', {}, 'stupid')]])) - command([[call assert_match("stupid: Expected {} but got 'E731:", v:errors[0])]]) - expected_errors({"stupid: Expected {} but got 'E731: using Dictionary as a String'"}) + eq(1, eval([[assert_fails('xxx', 'E9876', 'stupid')]])) + command([[call assert_match("stupid: Expected 'E9876' but got 'E492:", v:errors[0])]]) + expected_errors({"stupid: Expected 'E9876' but got 'E492: Not an editor command: xxx': stupid"}) end) it('can specify and get a message even when cmd succeeds', function() diff --git a/test/functional/legacy/backspace_opt_spec.lua b/test/functional/legacy/backspace_opt_spec.lua deleted file mode 100644 index 90bc6f74f0..0000000000 --- a/test/functional/legacy/backspace_opt_spec.lua +++ /dev/null @@ -1,67 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) -local call, clear = helpers.call, helpers.clear -local source, eq, nvim = helpers.source, helpers.eq, helpers.meths - -describe("test 'backspace' settings", function() - before_each(function() - clear() - - source([[ - func Exec(expr) - let str='' - try - exec a:expr - catch /.*/ - let str=v:exception - endtry - return str - endfunc - - func Test_backspace_option() - set backspace= - call assert_equal('', &backspace) - set backspace=indent - call assert_equal('indent', &backspace) - set backspace=eol - call assert_equal('eol', &backspace) - set backspace=start - call assert_equal('start', &backspace) - " Add the value - set backspace= - set backspace=indent - call assert_equal('indent', &backspace) - set backspace+=eol - call assert_equal('indent,eol', &backspace) - set backspace+=start - call assert_equal('indent,eol,start', &backspace) - " Delete the value - set backspace-=indent - call assert_equal('eol,start', &backspace) - set backspace-=start - call assert_equal('eol', &backspace) - set backspace-=eol - call assert_equal('', &backspace) - " Check the error - call assert_equal(0, match(Exec('set backspace=ABC'), '.*E474')) - call assert_equal(0, match(Exec('set backspace+=def'), '.*E474')) - " NOTE: Vim doesn't check following error... - "call assert_equal(0, match(Exec('set backspace-=ghi'), '.*E474')) - - " Check backwards compatibility with version 5.4 and earlier - set backspace=0 - call assert_equal('0', &backspace) - set backspace=1 - call assert_equal('1', &backspace) - set backspace=2 - call assert_equal('2', &backspace) - call assert_false(match(Exec('set backspace=3'), '.*E474')) - call assert_false(match(Exec('set backspace=10'), '.*E474')) - endfunc - ]]) - end) - - it('works', function() - call('Test_backspace_option') - eq({}, nvim.get_vvar('errors')) - end) -end) diff --git a/test/functional/legacy/memory_usage_spec.lua b/test/functional/legacy/memory_usage_spec.lua index fb0bacc2d2..5f7bbd887f 100644 --- a/test/functional/legacy/memory_usage_spec.lua +++ b/test/functional/legacy/memory_usage_spec.lua @@ -10,6 +10,29 @@ local source = helpers.source local poke_eventloop = helpers.poke_eventloop local uname = helpers.uname local load_adjust = helpers.load_adjust +local isCI = helpers.isCI + +local function isasan() + local version = eval('execute("version")') + return version:match('-fsanitize=[a-z,]*address') +end + +clear() +if isasan() then + pending('ASAN build is difficult to estimate memory usage', function() end) + return +elseif iswin() then + if isCI('github') then + pending('Windows runners in Github Actions do not have a stable environment to estimate memory usage', function() end) + return + elseif eval("executable('wmic')") == 0 then + pending('missing "wmic" command', function() end) + return + end +elseif eval("executable('ps')") == 0 then + pending('missing "ps" command', function() end) + return +end local monitor_memory_usage = { memory_usage = function(self) @@ -71,11 +94,6 @@ describe('memory usage', function() end end - local function isasan() - local version = eval('execute("version")') - return version:match('-fsanitize=[a-z,]*address') - end - before_each(clear) --[[ @@ -83,15 +101,6 @@ describe('memory usage', function() just after it finishes. ]]-- it('function capture vargs', function() - if isasan() then - pending('ASAN build is difficult to estimate memory usage') - end - if iswin() and eval("executable('wmic')") == 0 then - pending('missing "wmic" command') - elseif eval("executable('ps')") == 0 then - pending('missing "ps" command') - end - local pid = eval('getpid()') local before = monitor_memory_usage(pid) source([[ @@ -125,15 +134,6 @@ describe('memory usage', function() increase so much even when rerun Xtest.vim since system memory caches. ]]-- it('function capture lvars', function() - if isasan() then - pending('ASAN build is difficult to estimate memory usage') - end - if iswin() and eval("executable('wmic')") == 0 then - pending('missing "wmic" command') - elseif eval("executable('ps')") == 0 then - pending('missing "ps" command') - end - local pid = eval('getpid()') local before = monitor_memory_usage(pid) local fname = source([[ |