aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen_basic_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-04-06 01:07:22 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-04-06 01:07:22 +0200
commitcde51dd6f4ec91c4458dbdfaceee4110904e1fa8 (patch)
treea5892f6e0aca5f16e127b93fe8b0179f9064f868 /test/functional/ui/screen_basic_spec.lua
parent4566f7c7cda2c3a181ec58998f7c93dd17500153 (diff)
parent8863af28b8f756ab0e2063879adeb2b48871b61d (diff)
downloadrneovim-cde51dd6f4ec91c4458dbdfaceee4110904e1fa8.tar.gz
rneovim-cde51dd6f4ec91c4458dbdfaceee4110904e1fa8.tar.bz2
rneovim-cde51dd6f4ec91c4458dbdfaceee4110904e1fa8.zip
Merge #6440 'test: Remove "tickle" hack'
Diffstat (limited to 'test/functional/ui/screen_basic_spec.lua')
-rw-r--r--test/functional/ui/screen_basic_spec.lua50
1 files changed, 17 insertions, 33 deletions
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index e511234e5e..21953ba294 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -73,33 +73,29 @@ describe('Screen', function()
describe(':suspend', function()
it('is forwarded to the UI', function()
local function check()
- if not screen.suspended then
- return 'Screen was not suspended'
- end
+ eq(true, screen.suspended)
end
execute('suspend')
- screen:wait(check)
+ screen:expect(check)
screen.suspended = false
feed('<c-z>')
- screen:wait(check)
+ screen:expect(check)
end)
end)
describe('bell/visual bell', function()
it('is forwarded to the UI', function()
feed('<left>')
- screen:wait(function()
- if not screen.bell or screen.visual_bell then
- return 'Bell was not sent'
- end
+ screen:expect(function()
+ eq(true, screen.bell)
+ eq(false, screen.visual_bell)
end)
screen.bell = false
execute('set visualbell')
feed('<left>')
- screen:wait(function()
- if not screen.visual_bell or screen.bell then
- return 'Visual bell was not sent'
- end
+ screen:expect(function()
+ eq(true, screen.visual_bell)
+ eq(false, screen.bell)
end)
end)
end)
@@ -109,22 +105,16 @@ describe('Screen', function()
local expected = 'test-title'
execute('set titlestring='..expected)
execute('set title')
- screen:wait(function()
- local actual = screen.title
- if actual ~= expected then
- return 'Expected title to be "'..expected..'" but was "'..actual..'"'
- end
+ screen:expect(function()
+ eq(expected, screen.title)
end)
end)
it('has correct default title with unnamed file', function()
local expected = '[No Name] - NVIM'
execute('set title')
- screen:wait(function()
- local actual = screen.title
- if actual ~= expected then
- return 'Expected title to be "'..expected..'" but was "'..actual..'"'
- end
+ screen:expect(function()
+ eq(expected, screen.title)
end)
end)
@@ -132,11 +122,8 @@ describe('Screen', function()
local expected = 'myfile (/mydir) - NVIM'
execute('set title')
execute('file /mydir/myfile')
- screen:wait(function()
- local actual = screen.title
- if actual ~= expected then
- return 'Expected title to be "'..expected..'" but was "'..actual..'"'
- end
+ screen:expect(function()
+ eq(expected, screen.title)
end)
end)
end)
@@ -146,11 +133,8 @@ describe('Screen', function()
local expected = 'test-icon'
execute('set iconstring='..expected)
execute('set icon')
- screen:wait(function()
- local actual = screen.icon
- if actual ~= expected then
- return 'Expected title to be "'..expected..'" but was "'..actual..'"'
- end
+ screen:expect(function()
+ eq(expected, screen.icon)
end)
end)
end)