aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-07 17:58:38 -0400
committerGitHub <noreply@github.com>2020-10-07 17:58:38 -0400
commit8ba5f4d19c6a2fa0de07a82867c52e68f5a757b7 (patch)
tree5ddaeeafab707b6e32b6c49615ddae498ac3fb29 /src/nvim/testdir
parenta260d5def363ca30f0473365ea514f2dedd0d0ba (diff)
parent670a577c6b7b6f950c738261937c2b6d55a7faec (diff)
downloadrneovim-8ba5f4d19c6a2fa0de07a82867c52e68f5a757b7.tar.gz
rneovim-8ba5f4d19c6a2fa0de07a82867c52e68f5a757b7.tar.bz2
rneovim-8ba5f4d19c6a2fa0de07a82867c52e68f5a757b7.zip
Merge pull request #13064 from janlazo/vim-8.1.2325
vim-patch:8.1.{1683,1686,1692,1705,2325},8.2.1599
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_listdict.vim8
-rw-r--r--src/nvim/testdir/test_popup.vim47
-rw-r--r--src/nvim/testdir/test_quickfix.vim18
3 files changed, 73 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim
index bea62cb0ad..31a8b48d37 100644
--- a/src/nvim/testdir/test_listdict.vim
+++ b/src/nvim/testdir/test_listdict.vim
@@ -280,6 +280,14 @@ func Test_dict_func_remove_in_use()
call assert_equal(expected, d.func(string(remove(d, 'func'))))
endfunc
+func Test_dict_literal_keys()
+ call assert_equal({'one': 1, 'two2': 2, '3three': 3, '44': 4}, #{one: 1, two2: 2, 3three: 3, 44: 4},)
+
+ " why *{} cannot be used
+ let blue = 'blue'
+ call assert_equal('6', trim(execute('echo 2 *{blue: 3}.blue')))
+endfunc
+
" Nasty: deepcopy() dict that refers to itself (fails when noref used)
func Test_dict_deepcopy()
let d = {1:1, 2:2}
diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim
index bb0ed6e00c..fb464d95ea 100644
--- a/src/nvim/testdir/test_popup.vim
+++ b/src/nvim/testdir/test_popup.vim
@@ -2,6 +2,7 @@
source shared.vim
source screendump.vim
+source check.vim
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = ''
@@ -755,6 +756,52 @@ func Test_popup_and_previewwindow_dump()
call delete('Xscript')
endfunc
+func Test_balloon_split()
+ CheckFunction balloon_split
+
+ call assert_equal([
+ \ 'tempname: 0x555555e380a0 "/home/mool/.viminfz.tmp"',
+ \ ], balloon_split(
+ \ 'tempname: 0x555555e380a0 "/home/mool/.viminfz.tmp"'))
+ call assert_equal([
+ \ 'one two three four one two three four one two thre',
+ \ 'e four',
+ \ ], balloon_split(
+ \ 'one two three four one two three four one two three four'))
+
+ eval 'struct = {one = 1, two = 2, three = 3}'
+ \ ->balloon_split()
+ \ ->assert_equal([
+ \ 'struct = {',
+ \ ' one = 1,',
+ \ ' two = 2,',
+ \ ' three = 3}',
+ \ ])
+
+ call assert_equal([
+ \ 'struct = {',
+ \ ' one = 1,',
+ \ ' nested = {',
+ \ ' n1 = "yes",',
+ \ ' n2 = "no"}',
+ \ ' two = 2}',
+ \ ], balloon_split(
+ \ 'struct = {one = 1, nested = {n1 = "yes", n2 = "no"} two = 2}'))
+ call assert_equal([
+ \ 'struct = 0x234 {',
+ \ ' long = 2343 "\\"some long string that will be wr',
+ \ 'apped in two\\"",',
+ \ ' next = 123}',
+ \ ], balloon_split(
+ \ 'struct = 0x234 {long = 2343 "\\"some long string that will be wrapped in two\\"", next = 123}'))
+ call assert_equal([
+ \ 'Some comment',
+ \ '',
+ \ 'typedef this that;',
+ \ ], balloon_split(
+ \ "Some comment\n\ntypedef this that;"))
+endfunc
+
func Test_popup_position()
if !CanRunVimInTerminal()
return
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index 42ca0fe1d3..520007a993 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -1597,6 +1597,24 @@ func Test_long_lines()
call s:long_lines_tests('l')
endfunc
+func Test_cgetfile_on_long_lines()
+ " Problematic values if the line is longer than 4096 bytes. Then 1024 bytes
+ " are read at a time.
+ for len in [4078, 4079, 4080, 5102, 5103, 5104, 6126, 6127, 6128, 7150, 7151, 7152]
+ let lines = [
+ \ '/tmp/file1:1:1:aaa',
+ \ '/tmp/file2:1:1:%s',
+ \ '/tmp/file3:1:1:bbb',
+ \ '/tmp/file4:1:1:ccc',
+ \ ]
+ let lines[1] = substitute(lines[1], '%s', repeat('x', len), '')
+ call writefile(lines, 'Xcqetfile.txt')
+ cgetfile Xcqetfile.txt
+ call assert_equal(4, getqflist(#{size: v:true}).size, 'with length ' .. len)
+ endfor
+ call delete('Xcqetfile.txt')
+endfunc
+
func s:create_test_file(filename)
let l = []
for i in range(1, 20)