Skip to content

Commit fa592ca

Browse files
plexusbbatsov
authored andcommitted
Fix ClojureScript completion test for 1.10+
ClojureScript now includes a var named "private-var", which was interfering with the test. Instead use "my-private-var" for uniqueness.
1 parent 5a0154e commit fa592ca

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/clj/cider/nrepl/middleware/apropos_test.clj

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
[clojure.string :as str]
66
[clojure.test :refer :all]))
77

8-
(def ^:private ^{:doc "Can't. See. Me"} private-var [:a :b :c])
8+
(def ^:private ^{:doc "Can't. See. Me"} my-private-var [:a :b :c])
99

1010
(use-fixtures :each session/session-fixture)
11+
1112
(deftest integration-test
1213
(testing "Apropos op, typical case"
1314
(let [response (session/message {:op "apropos" :query "handle-apropos"})
@@ -18,22 +19,22 @@
1819

1920
(testing "Apropos op, but specialized cases (invoked with prefix argument)"
2021
(testing "Fails to get a private var because private? unset"
21-
(let [response (session/message {:op "apropos" :query "private-var"})
22+
(let [response (session/message {:op "apropos" :query "my-private-var"})
2223
match (get-in response [:apropos-matches 0])]
2324
(is (= (:status response) #{"done"}))
2425
(is (empty? match))))
2526

2627
(testing "Gets a private var using a case insensitive query"
27-
(let [response (session/message {:op "apropos" :query "PrIvAtE-VaR" :privates? "t"})
28+
(let [response (session/message {:op "apropos" :query "My-Private-Var" :privates? "t"})
2829
match (get-in response [:apropos-matches 0])]
2930
(is (= (:status response) #{"done"}))
3031
(is (= (:type match) "variable"))
31-
(is (= (:name match) "cider.nrepl.middleware.apropos-test/private-var"))
32+
(is (= (:name match) "cider.nrepl.middleware.apropos-test/my-private-var"))
3233
(is (= (:doc match) "Can't."))))
3334

3435
(testing "Fails to get a private var due to case-mismatch in a case sensitive query"
3536
(let [response (session/message {:op "apropos"
36-
:query "PrIvAtE-VaR"
37+
:query "My-Private-Var"
3738
:privates? "t"
3839
:case-sensitive? "t"})
3940
match (get-in response [:apropos-matches 0])]

0 commit comments

Comments
 (0)