aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_sort.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-24 14:43:47 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-24 15:25:32 -0400
commit1b0937dd894d4ea5d1c66f8037b4e1c4e2b888bd (patch)
treed4f14bd0d4e723780f19e4f10235758f46a47f88 /src/nvim/testdir/test_sort.vim
parent529d88c64164f69e8005192f75e392640c941b9f (diff)
downloadrneovim-1b0937dd894d4ea5d1c66f8037b4e1c4e2b888bd.tar.gz
rneovim-1b0937dd894d4ea5d1c66f8037b4e1c4e2b888bd.tar.bz2
rneovim-1b0937dd894d4ea5d1c66f8037b4e1c4e2b888bd.zip
test/old: partial port of patch v8.2.1.0183
Prep for patch v8.2.0511.
Diffstat (limited to 'src/nvim/testdir/test_sort.vim')
-rw-r--r--src/nvim/testdir/test_sort.vim29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim
index 6d55889641..570c4415c6 100644
--- a/src/nvim/testdir/test_sort.vim
+++ b/src/nvim/testdir/test_sort.vim
@@ -1,5 +1,7 @@
" Tests for the "sort()" function and for the ":sort" command.
+source check.vim
+
func Compare1(a, b) abort
call sort(range(3), 'Compare2')
return a:a - a:b
@@ -59,6 +61,7 @@ func Test_sort_numbers()
endfunc
func Test_sort_float()
+ CheckFeature float
call assert_equal([0.28, 3, 13.5], sort([13.5, 0.28, 3], 'f'))
endfunc
@@ -68,6 +71,8 @@ func Test_sort_nested()
endfunc
func Test_sort_default()
+ CheckFeature float
+
" docs say omitted, empty or zero argument sorts on string representation.
call assert_equal(['2', 'A', 'AA', 'a', 1, 3.3], sort([3.3, 1, "2", "A", "a", "AA"]))
call assert_equal(['2', 'A', 'AA', 'a', 1, 3.3], sort([3.3, 1, "2", "A", "a", "AA"], ''))
@@ -1176,30 +1181,6 @@ func Test_sort_cmd()
\ ]
\ },
\ {
- \ 'name' : 'float',
- \ 'cmd' : 'sort f',
- \ 'input' : [
- \ '1.234',
- \ '0.88',
- \ ' + 123.456',
- \ '1.15e-6',
- \ '-1.1e3',
- \ '-1.01e3',
- \ '',
- \ ''
- \ ],
- \ 'expected' : [
- \ '',
- \ '',
- \ '-1.1e3',
- \ '-1.01e3',
- \ '1.15e-6',
- \ '0.88',
- \ '1.234',
- \ ' + 123.456'
- \ ]
- \ },
- \ {
\ 'name' : 'alphabetical, sorted input',
\ 'cmd' : 'sort',
\ 'input' : [