Skip to content

Commit e69b0ac

Browse files
kommenbbatsov
authored andcommitted
Vendor s-index-of in test utils instead of requiring s
1 parent 869790b commit e69b0ac

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Eldev

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
(eldev-use-plugin 'autoloads)
1212

13-
(eldev-add-extra-dependencies 'test 'buttercup 's)
13+
(eldev-add-extra-dependencies 'test 'buttercup)
1414

1515
(setq byte-compile-docstring-max-column 240)
1616
(setq checkdoc-force-docstrings-flag nil)

test/clojure-ts-mode-indentation-test.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ DESCRIPTION is a string with the description of the spec."
4343
(declare (indent 1))
4444
`(it ,description
4545
(let* ((after ,after)
46-
(expected-cursor-pos (1+ (s-index-of "|" after)))
46+
(expected-cursor-pos (1+ (clojure-ts--s-index-of "|" after)))
4747
(expected-state (delete ?| after)))
4848
(with-clojure-ts-buffer ,before
4949
(goto-char (point-min))

test/test-helper.el

+9
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ and point left there."
4646
(delete-char -1)
4747
,@body)))
4848

49+
(defun clojure-ts--s-index-of (needle s &optional ignore-case)
50+
"Returns first index of NEEDLE in S, or nil.
51+
52+
If IGNORE-CASE is non-nil, the comparison is done without paying
53+
attention to case differences."
54+
(declare (pure t) (side-effect-free t))
55+
(let ((case-fold-search ignore-case))
56+
(string-match-p (regexp-quote needle) s)))
57+
4958
;;; test-helper.el ends here

0 commit comments

Comments
 (0)