aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/core/exit_spec.lua46
-rw-r--r--test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua12
-rw-r--r--test/functional/legacy/packadd_spec.lua7
-rw-r--r--test/functional/ui/screen.lua3
-rw-r--r--test/functional/ui/screen_basic_spec.lua47
5 files changed, 101 insertions, 14 deletions
diff --git a/test/functional/core/exit_spec.lua b/test/functional/core/exit_spec.lua
new file mode 100644
index 0000000000..3fb39f3e78
--- /dev/null
+++ b/test/functional/core/exit_spec.lua
@@ -0,0 +1,46 @@
+local helpers = require('test.functional.helpers')(after_each)
+
+local command = helpers.command
+local eval = helpers.eval
+local eq, neq = helpers.eq, helpers.neq
+local run = helpers.run
+
+describe('v:exiting', function()
+ local cid
+
+ before_each(function()
+ helpers.clear()
+ cid = helpers.nvim('get_api_info')[1]
+ end)
+
+ it('defaults to v:null', function()
+ eq(1, eval('v:exiting is v:null'))
+ end)
+
+ it('is 0 on normal exit', function()
+ local function on_setup()
+ command('autocmd VimLeavePre * call rpcrequest('..cid..', "")')
+ command('autocmd VimLeave * call rpcrequest('..cid..', "")')
+ command('quit')
+ end
+ local function on_request()
+ eq(0, eval('v:exiting'))
+ return ''
+ end
+ run(on_request, nil, on_setup)
+ end)
+
+ it('is non-zero after :cquit', function()
+ local function on_setup()
+ command('autocmd VimLeavePre * call rpcrequest('..cid..', "")')
+ command('autocmd VimLeave * call rpcrequest('..cid..', "")')
+ command('cquit')
+ end
+ local function on_request()
+ neq(0, eval('v:exiting'))
+ return ''
+ end
+ run(on_request, nil, on_setup)
+ end)
+
+end)
diff --git a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
index 4189e8a33a..c6883e4902 100644
--- a/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
+++ b/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
@@ -28,8 +28,6 @@ local function run_test_with_regexpengine(regexpengine)
e y
f z
g a啷bb
- h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ
- i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ
j 0123❤x
k combinations
l ä ö ü ᾱ̆́]])
@@ -68,14 +66,6 @@ local function run_test_with_regexpengine(regexpengine)
feed([[/\%U12345678<cr>x]])
feed([[/[\U1234abcd\u1234\uabcd]<cr>x]])
feed([[/\%d21879b<cr>x]])
- feed('/ [[=A=]]* [[=B=]]* [[=C=]]* [[=D=]]* [[=E=]]* [[=F=]]* ' ..
- '[[=G=]]* [[=H=]]* [[=I=]]* [[=J=]]* [[=K=]]* [[=L=]]* [[=M=]]* ' ..
- '[[=N=]]* [[=O=]]* [[=P=]]* [[=Q=]]* [[=R=]]* [[=S=]]* [[=T=]]* ' ..
- '[[=U=]]* [[=V=]]* [[=W=]]* [[=X=]]* [[=Y=]]* [[=Z=]]*/e<cr>x')
- feed('/ [[=a=]]* [[=b=]]* [[=c=]]* [[=d=]]* [[=e=]]* [[=f=]]* ' ..
- '[[=g=]]* [[=h=]]* [[=i=]]* [[=j=]]* [[=k=]]* [[=l=]]* [[=m=]]* ' ..
- '[[=n=]]* [[=o=]]* [[=p=]]* [[=q=]]* [[=r=]]* [[=s=]]* [[=t=]]* ' ..
- '[[=u=]]* [[=v=]]* [[=w=]]* [[=x=]]* [[=y=]]* [[=z=]]*/e<cr>x')
-- Line j. Test backwards search from a multi-byte character.
feed('/x<cr>x')
@@ -125,8 +115,6 @@ local function run_test_with_regexpengine(regexpengine)
e y
f z
g abb
- h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐ
- i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑ
j 012❤
k œ̄ṣ́m̥̄ᾱ̆́
l ä ö ü ᾱ̆́
diff --git a/test/functional/legacy/packadd_spec.lua b/test/functional/legacy/packadd_spec.lua
index 68bdbf5257..2d851819e3 100644
--- a/test/functional/legacy/packadd_spec.lua
+++ b/test/functional/legacy/packadd_spec.lua
@@ -27,7 +27,7 @@ describe('packadd', function()
endfunc
func Test_packadd()
- call mkdir(s:plugdir . '/plugin', 'p')
+ call mkdir(s:plugdir . '/plugin/also', 'p')
call mkdir(s:plugdir . '/ftdetect', 'p')
call mkdir(s:plugdir . '/after', 'p')
set rtp&
@@ -38,6 +38,10 @@ describe('packadd', function()
call setline(1, 'let g:plugin_works = 42')
wq
+ exe 'split ' . s:plugdir . '/plugin/also/loaded.vim'
+ call setline(1, 'let g:plugin_also_works = 77')
+ wq
+
exe 'split ' . s:plugdir . '/ftdetect/test.vim'
call setline(1, 'let g:ftdetect_works = 17')
wq
@@ -45,6 +49,7 @@ describe('packadd', function()
packadd mytest
call assert_true(42, g:plugin_works)
+ call assert_equal(77, g:plugin_also_works)
call assert_true(17, g:ftdetect_works)
call assert_true(len(&rtp) > len(rtp))
call assert_true(&rtp =~ (s:plugdir . '\($\|,\)'))
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 6c1a1788ce..ebe8af35eb 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -374,7 +374,8 @@ function Screen:_handle_mouse_off()
end
function Screen:_handle_mode_change(mode)
- assert(mode == 'insert' or mode == 'replace' or mode == 'normal')
+ assert(mode == 'insert' or mode == 'replace'
+ or mode == 'normal' or mode == 'cmdline')
self.mode = mode
end
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 593b6dd763..d03f98c26f 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -642,5 +642,52 @@ describe('Screen', function()
eq("normal", screen.mode)
end)
end)
+
+ it('works in cmdline mode', function()
+ feed(':')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ :^ |
+ ]],nil,nil,function ()
+ eq("cmdline", screen.mode)
+ end)
+
+ feed('<esc>/')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ /^ |
+ ]],nil,nil,function ()
+ eq("cmdline", screen.mode)
+ end)
+
+
+ feed('<esc>?')
+ screen:expect([[
+ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ ?^ |
+ ]],nil,nil,function ()
+ eq("cmdline", screen.mode)
+ end)
+
+ feed('<esc>')
+ screen:expect([[
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]],nil,nil,function ()
+ eq("normal", screen.mode)
+ end)
+ end)
end)
end)