Mercurial > vim
diff src/testdir/test55.in @ 6022:f9ec944e4474 v7.4.351
updated for version 7.4.351
Problem: sort() is not stable.
Solution: When the items are identical, compare the pointers.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 02 Jul 2014 19:06:18 +0200 |
parents | a162d41f10e1 |
children | 0a42938f449c |
line wrap: on
line diff
--- a/src/testdir/test55.in +++ b/src/testdir/test55.in @@ -332,9 +332,9 @@ let l = [0, 1, 2, 3] :$put =string(reverse(sort(l))) :$put =string(sort(reverse(sort(l)))) :$put =string(uniq(sort(l))) -:let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0.22, 'foo'] +:let l=[7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four'] :$put =string(sort(copy(l), 'n')) -:let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'foo', 'FOOBAR',{}, []] +:let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []] :$put =string(sort(copy(l), 1)) :$put =string(sort(copy(l), 'i')) :$put =string(sort(copy(l)))