aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/defaults_spec.lua
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2017-04-26 16:50:36 -0400
committerJames McCoy <jamessan@jamessan.com>2017-04-27 09:20:03 -0400
commite20691ccb47731b378e029e1223d3e87744f25c6 (patch)
tree7511847c7766675e9741ee042c00f51d5488f3ee /test/functional/options/defaults_spec.lua
parent67552621943a18cb38db8dc38bfb7639807ebdf5 (diff)
downloadrneovim-e20691ccb47731b378e029e1223d3e87744f25c6.tar.gz
rneovim-e20691ccb47731b378e029e1223d3e87744f25c6.tar.bz2
rneovim-e20691ccb47731b378e029e1223d3e87744f25c6.zip
defaults_spec: Test changing :filetype/:syntax in -c, after defaults
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-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()