aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/options/defaults_spec.lua41
1 files changed, 32 insertions, 9 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index f43d8eeafa..dc73679bb4 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -23,13 +23,13 @@ describe('startup defaults', function()
if helpers.pending_win32(pending) then return end
local function expect_filetype(expected)
- local screen = Screen.new(48, 4)
+ local screen = Screen.new(50, 4)
screen:attach()
command('filetype')
screen:expect([[
- ^ |
- ~ |
- ~ |
+ ^ |
+ ~ |
+ ~ |
]]..expected
)
end
@@ -37,31 +37,49 @@ describe('startup defaults', function()
it('enabled by `-u NORC`', function()
init_session('-u', 'NORC')
expect_filetype(
- 'filetype detection:ON plugin:ON indent:ON |')
+ 'filetype detection:ON plugin:ON indent:ON |')
end)
it('disabled by `-u NONE`', function()
init_session('-u', 'NONE')
expect_filetype(
- 'filetype detection:OFF plugin:OFF indent:OFF |')
+ 'filetype detection:OFF plugin:OFF indent:OFF |')
end)
it('overridden by early `filetype on`', function()
init_session('-u', 'NORC', '--cmd', 'filetype on')
expect_filetype(
- 'filetype detection:ON plugin:OFF indent:OFF |')
+ 'filetype detection:ON plugin:OFF indent:OFF |')
end)
it('overridden by early `filetype plugin on`', function()
init_session('-u', 'NORC', '--cmd', 'filetype plugin on')
expect_filetype(
- 'filetype detection:ON plugin:ON indent:OFF |')
+ 'filetype detection:ON plugin:ON indent:OFF |')
end)
it('overridden by early `filetype indent on`', function()
init_session('-u', 'NORC', '--cmd', 'filetype indent on')
expect_filetype(
- 'filetype detection:ON plugin:OFF indent:ON |')
+ 'filetype detection:ON plugin:OFF indent:ON |')
+ end)
+
+ it('adjusted by late `filetype off`', function()
+ init_session('-u', 'NORC', '-c', 'filetype off')
+ expect_filetype(
+ 'filetype detection:OFF plugin:(on) indent:(on) |')
+ end)
+
+ it('adjusted by late `filetype plugin off`', function()
+ init_session('-u', 'NORC', '-c', 'filetype plugin off')
+ expect_filetype(
+ 'filetype detection:ON plugin:OFF indent:ON |')
+ end)
+
+ it('adjusted by late `filetype indent off`', function()
+ init_session('-u', 'NORC', '-c', 'filetype indent off')
+ expect_filetype(
+ 'filetype detection:ON plugin:ON indent:OFF |')
end)
end)
@@ -80,6 +98,11 @@ describe('startup defaults', function()
init_session('-u', 'NORC', '--cmd', 'syntax off')
eq(0, eval('exists("g:syntax_on")'))
end)
+
+ it('adjusted by late `syntax off`', function()
+ init_session('-u', 'NORC', '-c', 'syntax off')
+ eq(0, eval('exists("g:syntax_on")'))
+ end)
end)
describe('packpath', function()