Mercurial > vim
view src/testdir/test_sort.vim @ 7877:7fbd2de703a9 v7.4.1235
commit https://github.com/vim/vim/commit/11e0afa00a8e6c0aa1d50f760b5d5cb62dade038
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 1 22:41:00 2016 +0100
patch 7.4.1235
Problem: Missing change to eval.c.
Solution: Include that change.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 01 Feb 2016 22:45:06 +0100 |
parents | 20dc2763a3b9 |
children | c16aa03d8db5 |
line wrap: on
line source
" Test sort() func Test_sort_strings() " numbers compared as strings call assert_equal([1, 2, 3], sort([3, 2, 1])) call assert_equal([13, 28, 3], sort([3, 28, 13])) endfunc func Test_sort_numeric() call assert_equal([1, 2, 3], sort([3, 2, 1], 'n')) call assert_equal([3, 13, 28], sort([13, 28, 3], 'n')) " strings are not sorted call assert_equal(['13', '28', '3'], sort(['13', '28', '3'], 'n')) endfunc func Test_sort_numbers() call assert_equal([3, 13, 28], sort([13, 28, 3], 'N')) call assert_equal(['3', '13', '28'], sort(['13', '28', '3'], 'N')) endfunc func Test_sort_float() call assert_equal([0.28, 3, 13.5], sort([13.5, 0.28, 3], 'f')) endfunc