[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/clojure-ts-mode e69b0ac63b 4/4: Vendor s-index-of in test
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/clojure-ts-mode e69b0ac63b 4/4: Vendor s-index-of in test utils instead of requiring s |
Date: |
Thu, 31 Oct 2024 03:59:41 -0400 (EDT) |
branch: elpa/clojure-ts-mode
commit e69b0ac63b864f82df3f194aebf4d453d82ccb9c
Author: Dieter Komendera <dieter@komendera.com>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>
Vendor s-index-of in test utils instead of requiring s
---
Eldev | 2 +-
test/clojure-ts-mode-indentation-test.el | 2 +-
test/test-helper.el | 9 +++++++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Eldev b/Eldev
index 2030e26485..e6b3c00d3e 100644
--- a/Eldev
+++ b/Eldev
@@ -10,7 +10,7 @@
(eldev-use-plugin 'autoloads)
-(eldev-add-extra-dependencies 'test 'buttercup 's)
+(eldev-add-extra-dependencies 'test 'buttercup)
(setq byte-compile-docstring-max-column 240)
(setq checkdoc-force-docstrings-flag nil)
diff --git a/test/clojure-ts-mode-indentation-test.el
b/test/clojure-ts-mode-indentation-test.el
index be77588675..e4d73a6fc6 100644
--- a/test/clojure-ts-mode-indentation-test.el
+++ b/test/clojure-ts-mode-indentation-test.el
@@ -43,7 +43,7 @@ DESCRIPTION is a string with the description of the spec."
(declare (indent 1))
`(it ,description
(let* ((after ,after)
- (expected-cursor-pos (1+ (s-index-of "|" after)))
+ (expected-cursor-pos (1+ (clojure-ts--s-index-of "|" after)))
(expected-state (delete ?| after)))
(with-clojure-ts-buffer ,before
(goto-char (point-min))
diff --git a/test/test-helper.el b/test/test-helper.el
index 38bce567bd..386600312f 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -46,4 +46,13 @@ and point left there."
(delete-char -1)
,@body)))
+(defun clojure-ts--s-index-of (needle s &optional ignore-case)
+ "Returns first index of NEEDLE in S, or nil.
+
+If IGNORE-CASE is non-nil, the comparison is done without paying
+attention to case differences."
+ (declare (pure t) (side-effect-free t))
+ (let ((case-fold-search ignore-case))
+ (string-match-p (regexp-quote needle) s)))
+
;;; test-helper.el ends here