forked from aniani/vim
patch 7.4.1464
Problem: When the argument of sort() is zero or empty it fails. Solution: Make zero work as documented. (suggested by Yasuhiro Matsumoto)
This commit is contained in:
@@ -35,3 +35,11 @@ func Test_sort_nested()
|
||||
" test ability to call sort() from a compare function
|
||||
call assert_equal([1, 3, 5], sort([3, 1, 5], 'Compare1'))
|
||||
endfunc
|
||||
|
||||
func Test_sort_default()
|
||||
" docs say omitted, empty or zero argument sorts on string representation.
|
||||
call assert_equal(["2", 1, 3.3], sort([3.3, 1, "2"]))
|
||||
call assert_equal(["2", 1, 3.3], sort([3.3, 1, "2"], ''))
|
||||
call assert_equal(["2", 1, 3.3], sort([3.3, 1, "2"], 0))
|
||||
call assert_fails('call sort([3.3, 1, "2"], 3)', "E474")
|
||||
endfunc
|
||||
|
||||
Reference in New Issue
Block a user