aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/mode_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/mode_spec.lua')
-rw-r--r--test/functional/ui/mode_spec.lua78
1 files changed, 36 insertions, 42 deletions
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua
index 8d7fae3e91..f623cfda06 100644
--- a/test/functional/ui/mode_spec.lua
+++ b/test/functional/ui/mode_spec.lua
@@ -1,9 +1,10 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command = helpers.command
-local retry = helpers.retry
+local clear, feed, insert = n.clear, n.feed, n.insert
+local command = n.command
+local retry = t.retry
describe('ui mode_change event', function()
local screen
@@ -12,20 +13,13 @@ describe('ui mode_change event', function()
clear()
screen = Screen.new(25, 4)
screen:attach({ rgb = true })
- screen:set_default_attr_ids({
- [0] = { bold = true, foreground = 255 },
- [1] = { bold = true, reverse = true },
- [2] = { bold = true },
- [3] = { reverse = true },
- [4] = { background = Screen.colors.Red, foreground = Screen.colors.White }, -- ErrorMsg
- })
end)
it('works in normal mode', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -35,7 +29,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'operator',
@@ -45,7 +39,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -61,7 +55,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'operator',
@@ -71,8 +65,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {4:E21: Cannot make changes, 'modifiable' is off} |
+ {1:~ }|*2
+ {9:E21: Cannot make changes, 'modifiable' is off} |
]],
mode = 'normal',
}
@@ -84,7 +78,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'replace',
@@ -94,7 +88,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -106,8 +100,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
}
@@ -116,7 +110,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -133,8 +127,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@@ -144,8 +138,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word^(stuff) |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'showmatch',
timeout = screen_timeout,
@@ -154,8 +148,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
word(stuff)^ |
- {0:~ }|*2
- {2:-- INSERT --} |
+ {1:~ }|*2
+ {5:-- INSERT --} |
]],
mode = 'insert',
timeout = screen_timeout,
@@ -168,8 +162,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
- {2:-- REPLACE --} |
+ {1:~ }|*2
+ {5:-- REPLACE --} |
]],
mode = 'replace',
}
@@ -178,7 +172,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
wor^d |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -190,7 +184,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^ |
]],
mode = 'cmdline_normal',
@@ -200,7 +194,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^x |
]],
mode = 'cmdline_insert',
@@ -210,7 +204,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:^x |
]],
mode = 'cmdline_replace',
@@ -220,7 +214,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
|
- {0:~ }|*2
+ {1:~ }|*2
:x^ |
]],
mode = 'cmdline_normal',
@@ -230,7 +224,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
^ |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -243,8 +237,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
- {2:-- VISUAL --} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]],
mode = 'visual',
}
@@ -253,7 +247,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',
@@ -264,8 +258,8 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
- {2:-- VISUAL --} |
+ {1:~ }|*2
+ {5:-- VISUAL --} |
]],
mode = 'visual_select',
}
@@ -274,7 +268,7 @@ describe('ui mode_change event', function()
screen:expect {
grid = [[
tex^t |
- {0:~ }|*2
+ {1:~ }|*2
|
]],
mode = 'normal',