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

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

[nongnu] elpa/flx 78dc69a666 023/182: fix query with CAPITAL letters


From: ELPA Syncer
Subject: [nongnu] elpa/flx 78dc69a666 023/182: fix query with CAPITAL letters
Date: Tue, 13 Dec 2022 03:59:17 -0500 (EST)

branch: elpa/flx
commit 78dc69a66622579206bf6c6163b67300562fb12d
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>

    fix query with CAPITAL letters
---
 flx.el            | 3 ++-
 tests/flx-test.el | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/flx.el b/flx.el
index 350adf8fb5..7d429c1d37 100644
--- a/flx.el
+++ b/flx.el
@@ -13,7 +13,7 @@
 ;; Version: 0.1
 ;; Last-Updated:
 ;;           By:
-;;     Update #: 3
+;;     Update #: 4
 ;; URL:
 ;; Keywords:
 ;; Compatibility:
@@ -279,6 +279,7 @@ e.g. (\"aab\" \"ab\") returns
 
 (defun flx-score (str query &optional cache)
   "return best score matching QUERY against STR"
+  (setq query (downcase query))
   (unless (or (zerop (length query))
               (zerop (length str)))
     (let* ((info-hash (flx-process-cache str cache))
diff --git a/tests/flx-test.el b/tests/flx-test.el
index eace83870a..73b30b6fb1 100644
--- a/tests/flx-test.el
+++ b/tests/flx-test.el
@@ -13,7 +13,7 @@
 ;; Version: 0.1
 ;; Last-Updated:
 ;;           By:
-;;     Update #: 2
+;;     Update #: 4
 ;; URL:
 ;; Keywords:
 ;; Compatibility:
@@ -157,6 +157,10 @@
           ".")))
 
 
+(ert-deftest flx-score-capital ()
+  "QUERY should be downcased."
+  (should (flx-score "abc" "A" (flx-make-filename-cache))))
+
 (ert-deftest flx-score-string ()
   "score as string"
   (let ((string-as-path-score (flx-score "a/b" "a" (flx-make-string-cache)))



reply via email to

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