aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fns-tests.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 762f7bdd94f..0c6edb89252 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -191,3 +191,20 @@
191 (string-collate-lessp 191 (string-collate-lessp
192 a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))))) 192 a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8")))))
193 '("Adrian" "Ævar" "Agustín" "Eli")))) 193 '("Adrian" "Ævar" "Agustín" "Eli"))))
194
195(ert-deftest fns-tests-string-numeric-lessp ()
196 (should (string-numeric-lessp "foo2.png" "foo12.png"))
197 (should (not (string-numeric-lessp "foo12.png" "foo2.png")))
198 (should (string-numeric-lessp "foo12.png" "foo20000.png"))
199 (should (not (string-numeric-lessp "foo20000.png" "foo12.png")))
200 (should (string-numeric-lessp "foo.png" "foo2.png"))
201 (should (not (string-numeric-lessp "foo2.png" "foo.png")))
202 (should (equal (sort '("foo12.png" "foo2.png" "foo1.png")
203 'string-numeric-lessp)
204 '("foo1.png" "foo2.png" "foo12.png")))
205 (should (string-numeric-lessp "foo2" "foo1234"))
206 (should (not (string-numeric-lessp "foo1234" "foo2")))
207 (should (string-numeric-lessp "foo.png" "foo2"))
208 (should (string-numeric-lessp "foo1.25.5.png" "foo1.125.5"))
209 (should (string-numeric-lessp "2" "1245"))
210 (should (not (string-numeric-lessp "1245" "2"))))