Skip to content

Commit de898ed

Browse files
committed
Replace s-index-of with cl-position in test helpers
Drop the optional dependency on the s.el library by using cl-position (from cl-lib, already required) instead of s-index-of for finding the pipe character position in test strings.
1 parent 9b6098e commit de898ed

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

test/clojure-mode-indentation-test.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
(require 'clojure-mode)
2727
(require 'cl-lib)
2828
(require 'buttercup)
29-
(require 's nil t) ;Don't burp if it's missing during compilation.
3029
(require 'test-helper "test/utils/test-helper")
3130

3231
(defmacro when-indenting-with-point-it (description before after)
@@ -46,7 +45,7 @@ DESCRIPTION is a string with the description of the spec."
4645
`(it ,description
4746
(let* ((after ,after)
4847
(clojure-indent-style 'always-align)
49-
(expected-cursor-pos (1+ (s-index-of "|" after)))
48+
(expected-cursor-pos (1+ (cl-position ?| after)))
5049
(expected-state (delete ?| after)))
5150
(with-clojure-buffer ,before
5251
(goto-char (point-min))

test/utils/test-helper.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
;;; Code:
2525

26+
(require 'cl-lib)
27+
2628
(message "Running tests on Emacs %s" emacs-version)
2729

2830
(defmacro with-clojure-buffer (text &rest body)
@@ -78,7 +80,7 @@ DESCRIPTION is a string with the description of the spec."
7880
(declare (indent 1))
7981
`(it ,description
8082
(let* ((after ,after)
81-
(expected-cursor-pos (1+ (s-index-of "|" after)))
83+
(expected-cursor-pos (1+ (cl-position ?| after)))
8284
(expected-state (delete ?| after)))
8385
(with-clojure-buffer ,before
8486
(goto-char (point-min))

0 commit comments

Comments
 (0)