]> granicus.if.org Git - vim/commitdiff
patch 8.2.4450: list sort test fails v8.2.4450
authorBram Moolenaar <Bram@vim.org>
Tue, 22 Feb 2022 22:17:00 +0000 (22:17 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 22 Feb 2022 22:17:00 +0000 (22:17 +0000)
Problem:    List sort test fails.
Solution:   Pass a valid "how" argument.

src/testdir/test_listdict.vim
src/version.c

index 5337254fdb591bf201bad20309fe57b0b4b2a183..889c571b00f9bfd3091c12a77d3e000b37a3310f 100644 (file)
@@ -934,6 +934,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)))
@@ -949,12 +952,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 v9.CheckLegacyAndVim9Success(lines)
+  delfunc g:RetOne
 
   call assert_fails('call reverse("")', 'E899:')
   call assert_fails('call uniq([1, 2], {x, y -> []})', 'E745:')
index 2cc415521568a03f4948a5a8657030572d72abf8..5dfdaf4f03f8613e454e0d7720b3b250850881e4 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4450,
 /**/
     4449,
 /**/