aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-17 15:40:18 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-08-17 16:06:51 +0800
commitcda0abdb02282ddf54fb79e66ad3e3cbca6fec90 (patch)
tree033c6bd9232ed17d3c293d36361c908f0af5804a
parent200dafb8a5839826bc157bdc9153f1171ce639e1 (diff)
downloadrneovim-cda0abdb02282ddf54fb79e66ad3e3cbca6fec90.tar.gz
rneovim-cda0abdb02282ddf54fb79e66ad3e3cbca6fec90.tar.bz2
rneovim-cda0abdb02282ddf54fb79e66ad3e3cbca6fec90.zip
vim-patch:8.2.4450: list sort test fails
Problem: List sort test fails. Solution: Pass a valid "how" argument. https://github.com/vim/vim/commit/2afeb408310f4f0185ce5eec079b51a3fe415a33 Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--test/old/testdir/test_listdict.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim
index 593fd12c1e..049c4ed330 100644
--- a/test/old/testdir/test_listdict.vim
+++ b/test/old/testdir/test_listdict.vim
@@ -872,6 +872,9 @@ endfunc
" Tests for reverse(), sort(), uniq()
func Test_reverse_sort_uniq()
+ func g:RetOne()
+ return 1
+ endfunc
let lines =<< trim END
VAR l = ['-0', 'A11', 2, 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5]
call assert_equal(['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', 'foo', [0, 1, 2], 'x8', [0, 1, 2], 1.5], uniq(copy(l)))
@@ -887,12 +890,13 @@ func Test_reverse_sort_uniq()
call assert_equal([-1, 'one', 'two', 'three', 'four', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255], sort(copy(l), 'n'))
LET l = [7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []]
- call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 1))
+ call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), g:RetOne()))
call assert_equal(['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l), 'i'))
call assert_equal(['BAR', 'Bar', 'FOO', 'FOOBAR', 'Foo', 'bar', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}], sort(copy(l)))
endif
END
call CheckLegacyAndVim9Success(lines)
+ delfunc g:RetOne
call assert_fails('call reverse("")', 'E899:')
call assert_fails('call uniq([1, 2], {x, y -> []})', 'E745:')