branch: elpa/flx commit 78dc69a66622579206bf6c6163b67300562fb12d Author: Le Wang <le.w...@agworld.com.au> Commit: Le Wang <le.w...@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)))