emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/compat b962db5a24 5/8: Test string-equal-ignore-case


From: ELPA Syncer
Subject: [elpa] externals/compat b962db5a24 5/8: Test string-equal-ignore-case
Date: Wed, 4 Jan 2023 14:57:26 -0500 (EST)

branch: externals/compat
commit b962db5a240a543132d02822f5c6f56da0e4b483
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Test string-equal-ignore-case
---
 compat-29.el    | 2 +-
 compat-tests.el | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/compat-29.el b/compat-29.el
index 48470d49f7..3d16539290 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -99,7 +99,7 @@ If N is greater or equal to the length of LIST, return LIST 
(or a copy)."
       (setq n (1- n)))
     (nreverse copy)))
 
-(compat-defun string-equal-ignore-case (string1 string2) ;; <UNTESTED>
+(compat-defun string-equal-ignore-case (string1 string2) ;; <OK>
   "Like `string-equal', but case-insensitive.
 Upper-case and lower-case letters are treated as equal.
 Unibyte strings are converted to multibyte for comparison."
diff --git a/compat-tests.el b/compat-tests.el
index 77833e5d57..64eca34ed3 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -870,6 +870,13 @@
   (should-equal '[1 2 3] (compat-call sort '[1 2 3] #'<))
   (should-equal '[1 2 3] (compat-call sort '[3 2 1] #'<)))
 
+(ert-deftest string-equal-ignore-case ()
+  (should (string-equal-ignore-case "abc" "abc"))
+  (should (string-equal-ignore-case "abc" "ABC"))
+  (should (string-equal-ignore-case "abc" "abC"))
+  (should-not (string-equal-ignore-case "abc" "abCD"))
+  (should (string-equal-ignore-case "S" "s")))
+
 (ert-deftest string-greaterp ()
   (should (string-greaterp "b" "a"))
   (should-not (string-greaterp "a" "b"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]