aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/fns-tests.el18
2 files changed, 22 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 7546dd1fb46..70c2af66194 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
12014-08-29 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * automated/fns-tests.el (fns-tests-sort): New test.
4
12014-08-28 Glenn Morris <rgm@gnu.org> 52014-08-28 Glenn Morris <rgm@gnu.org>
2 6
3 * automated/python-tests.el (python-shell-calculate-exec-path-2): 7 * automated/python-tests.el (python-shell-calculate-exec-path-2):
diff --git a/test/automated/fns-tests.el b/test/automated/fns-tests.el
index d3d921f425f..a6c45443db6 100644
--- a/test/automated/fns-tests.el
+++ b/test/automated/fns-tests.el
@@ -100,3 +100,21 @@
100 (should (compare-strings "こんにちはコンニチハ" nil nil "こんにちはコンニチハ" nil nil)) 100 (should (compare-strings "こんにちはコンニチハ" nil nil "こんにちはコンニチハ" nil nil))
101 (should (= (compare-strings "んにちはコンニチハこ" nil nil "こんにちはコンニチハ" nil nil) 1)) 101 (should (= (compare-strings "んにちはコンニチハこ" nil nil "こんにちはコンニチハ" nil nil) 1))
102 (should (= (compare-strings "こんにちはコンニチハ" nil nil "んにちはコンニチハこ" nil nil) -1))) 102 (should (= (compare-strings "こんにちはコンニチハ" nil nil "んにちはコンニチハこ" nil nil) -1)))
103
104(ert-deftest fns-tests-sort ()
105 (should (equal (sort '(9 5 2 -1 5 3 8 7 4) (lambda (x y) (< x y)))
106 '(-1 2 3 4 5 5 7 8 9)))
107 (should (equal (sort '(9 5 2 -1 5 3 8 7 4) (lambda (x y) (> x y)))
108 '(9 8 7 5 5 4 3 2 -1)))
109 (should (equal (sort '[9 5 2 -1 5 3 8 7 4] (lambda (x y) (< x y)))
110 [-1 2 3 4 5 5 7 8 9]))
111 (should (equal (sort '[9 5 2 -1 5 3 8 7 4] (lambda (x y) (> x y)))
112 [9 8 7 5 5 4 3 2 -1]))
113 (should (equal
114 (sort
115 (vector
116 (cons 8 "xxx") (cons 9 "aaa") (cons 8 "bbb") (cons 9 "zzz")
117 (cons 9 "ppp") (cons 8 "ttt") (cons 8 "eee") (cons 9 "fff"))
118 (lambda (x y) (< (car x) (car y))))
119 [(8 . "xxx") (8 . "bbb") (8 . "ttt") (8 . "eee")
120 (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")])))