diff options
Diffstat (limited to 'test/functional/eval')
-rw-r--r-- | test/functional/eval/execute_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/eval/input_spec.lua | 16 | ||||
-rw-r--r-- | test/functional/eval/timer_spec.lua | 15 |
3 files changed, 23 insertions, 12 deletions
diff --git a/test/functional/eval/execute_spec.lua b/test/functional/eval/execute_spec.lua index 925e311c7d..af37ab8d55 100644 --- a/test/functional/eval/execute_spec.lua +++ b/test/functional/eval/execute_spec.lua @@ -161,13 +161,13 @@ describe('execute()', function() eq('42', eval('g:mes')) command('let g:mes = execute("echon 13", "silent")') - screen:expect([[ + screen:expect{grid=[[ ^ | ~ | ~ | ~ | | - ]]) + ]], unchanged=true} eq('13', eval('g:mes')) end) diff --git a/test/functional/eval/input_spec.lua b/test/functional/eval/input_spec.lua index 777f49462d..82e75d7a8e 100644 --- a/test/functional/eval/input_spec.lua +++ b/test/functional/eval/input_spec.lua @@ -150,13 +150,13 @@ describe('input()', function() {T:Foo>}Bar^ | ]]) command('redraw!') - screen:expect([[ + screen:expect{grid=[[ | {EOB:~ }| {EOB:~ }| {EOB:~ }| {T:Foo>}Bar^ | - ]]) + ]], reset=true} feed('<BS>') screen:expect([[ | @@ -166,13 +166,13 @@ describe('input()', function() {T:Foo>}Ba^ | ]]) command('redraw!') - screen:expect([[ + screen:expect{grid=[[ | {EOB:~ }| {EOB:~ }| {EOB:~ }| {T:Foo>}Ba^ | - ]]) + ]], reset=true} end) it('allows omitting everything with dictionary argument', function() command('echohl Test') @@ -348,13 +348,13 @@ describe('inputdialog()', function() {T:Foo>}Bar^ | ]]) command('redraw!') - screen:expect([[ + screen:expect{grid=[[ | {EOB:~ }| {EOB:~ }| {EOB:~ }| {T:Foo>}Bar^ | - ]]) + ]], reset=true} feed('<BS>') screen:expect([[ | @@ -364,13 +364,13 @@ describe('inputdialog()', function() {T:Foo>}Ba^ | ]]) command('redraw!') - screen:expect([[ + screen:expect{grid=[[ | {EOB:~ }| {EOB:~ }| {EOB:~ }| {T:Foo>}Ba^ | - ]]) + ]], reset=true} end) it('allows omitting everything with dictionary argument', function() command('echohl Test') diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 040ab30522..c945f12e0e 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -113,7 +113,6 @@ describe('timers', function() ^ | ]]) - screen:sleep(200) screen:expect([[ ITEM 1 | ITEM 2 | @@ -200,13 +199,14 @@ describe('timers', function() screen:attach() screen:set_default_attr_ids( {[0] = {bold=true, foreground=255}} ) source([[ + let g:val = 0 func! MyHandler(timer) echo "evil" + let g:val = 1 endfunc ]]) command("call timer_start(100, 'MyHandler', {'repeat': 1})") feed(":good") - screen:sleep(200) screen:expect([[ | {0:~ }| @@ -215,6 +215,17 @@ describe('timers', function() {0:~ }| :good^ | ]]) + + screen:expect{grid=[[ + | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + :good^ | + ]], intermediate=true, timeout=200} + + eq(1, eval('g:val')) end) end) |