diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/fns-tests.el | 31 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 08492dd4c8f..3cb03b9f2f4 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-06-25 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * automated/fns-tests.el (fns-tests-compare-string): New test. | ||
| 4 | |||
| 1 | 2014-06-24 Michael Albinus <michael.albinus@gmx.de> | 5 | 2014-06-24 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 6 | ||
| 3 | * automated/tramp-tests.el (tramp-test26-process-file): Extend test | 7 | * automated/tramp-tests.el (tramp-test26-process-file): Extend test |
diff --git a/test/automated/fns-tests.el b/test/automated/fns-tests.el index 21a9e4536af..461995b602e 100644 --- a/test/automated/fns-tests.el +++ b/test/automated/fns-tests.el | |||
| @@ -69,3 +69,34 @@ | |||
| 69 | (nreverse A) | 69 | (nreverse A) |
| 70 | (should (equal [nil nil nil nil nil t t t t t] (vconcat A))) | 70 | (should (equal [nil nil nil nil nil t t t t t] (vconcat A))) |
| 71 | (should (equal [t t t t t nil nil nil nil nil] (vconcat (nreverse A)))))) | 71 | (should (equal [t t t t t nil nil nil nil nil] (vconcat (nreverse A)))))) |
| 72 | |||
| 73 | (ert-deftest fns-tests-compare-strings () | ||
| 74 | (should-error (compare-strings)) | ||
| 75 | (should-error (compare-strings "xyzzy" "xyzzy")) | ||
| 76 | (should-error (compare-strings "xyzzy" 0 10 "zyxxy" 0 5)) | ||
| 77 | (should-error (compare-strings "xyzzy" 0 5 "zyxxy" -1 2)) | ||
| 78 | (should-error (compare-strings "xyzzy" 'foo nil "zyxxy" 0 1)) | ||
| 79 | (should-error (compare-strings "xyzzy" 0 'foo "zyxxy" 2 3)) | ||
| 80 | (should-error (compare-strings "xyzzy" 0 2 "zyxxy" 'foo 3)) | ||
| 81 | (should-error (compare-strings "xyzzy" nil 3 "zyxxy" 4 'foo)) | ||
| 82 | (should (compare-strings "" nil nil "" nil nil)) | ||
| 83 | (should (compare-strings "" 0 0 "" 0 0)) | ||
| 84 | (should (compare-strings "test" nil nil "test" nil nil)) | ||
| 85 | (should (compare-strings "test" nil nil "test" nil nil t)) | ||
| 86 | (should (compare-strings "test" nil nil "test" nil nil nil)) | ||
| 87 | (should (compare-strings "Test" nil nil "test" nil nil t)) | ||
| 88 | (should (= (compare-strings "Test" nil nil "test" nil nil) -1)) | ||
| 89 | (should (= (compare-strings "Test" nil nil "test" nil nil) -1)) | ||
| 90 | (should (= (compare-strings "test" nil nil "Test" nil nil) 1)) | ||
| 91 | (should (= (compare-strings "foobaz" nil nil "barbaz" nil nil) 1)) | ||
| 92 | (should (= (compare-strings "barbaz" nil nil "foobar" nil nil) -1)) | ||
| 93 | (should (= (compare-strings "foobaz" nil nil "farbaz" nil nil) 2)) | ||
| 94 | (should (= (compare-strings "farbaz" nil nil "foobar" nil nil) -2)) | ||
| 95 | (should (compare-strings "abcxyz" 0 2 "abcprq" 0 2)) | ||
| 96 | (should (compare-strings "abcxyz" 0 -3 "abcprq" 0 -3)) | ||
| 97 | (should (= (compare-strings "abcxyz" 0 6 "abcprq" 0 6) 4)) | ||
| 98 | (should (= (compare-strings "abcprq" 0 6 "abcxyz" 0 6) -4)) | ||
| 99 | (should (compare-strings "xyzzy" -3 4 "azza" -3 3)) | ||
| 100 | (should (compare-strings "こんにちはコンニチハ" nil nil "こんにちはコンニチハ" nil nil)) | ||
| 101 | (should (= (compare-strings "んにちはコンニチハこ" nil nil "こんにちはコンニチハ" nil nil) 1)) | ||
| 102 | (should (= (compare-strings "こんにちはコンニチハ" nil nil "んにちはコンニチハこ" nil nil) -1))) | ||