Skip to content

Commit

Permalink
Vendor s-index-of in test utils instead of requiring s
Browse files Browse the repository at this point in the history
  • Loading branch information
kommen committed Oct 30, 2024
1 parent 27891eb commit 4c06fed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Eldev
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/clojure-ts-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 9 additions & 0 deletions test/test-helper.el
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4c06fed

Please sign in to comment.