Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* src/main/clojure/clojure/core/match.clj: silly mistake, tests passi…

…ng, including MATCH-43
  • Loading branch information...
commit b2ee29d701a9306c1c494d91c371c01a512aee0c 1 parent 27d8242
@swannodette swannodette authored
View
4 src/main/clojure/clojure/core/match.clj
@@ -566,14 +566,12 @@
;; up until the point that the first wildcard pattern appears in a
;; column. everything including and after a wildcard pattern is always
;; the default matrix
-
- ;; we don't want use pattern-equals because that's overriden by *recur-present*
(group-rows [rows]
(let [[l r] (split-with #(not (wildcard-pattern? (first %))) rows)]
(letfn [(group [[r & rs :as rows]]
(if (seq rows)
(let [[fd rd] ((juxt filter remove)
- #(pattern-compare (first r) (first %))
+ #(pattern-equals (first r) (first %))
rs)]
(concat (cons r fd) (group rd)))))]
(into [] (concat (group l) r)))))
View
16 src/test/clojure/clojure/core/match/test/core.clj
@@ -565,9 +565,8 @@
:else :a4)
:a0)))
-;; FAILS
-#_(deftest match-order-6
- (is (= (match [[2]]
+(deftest match-order-6
+ (is (= (match [[2]]
[[1]] :a0
[1] :a1
[[2]] :a2
@@ -575,8 +574,7 @@
:else :a4)
:a2)))
-;; FAILS
-#_(deftest match-order-6-recur
+(deftest match-order-6-recur
(is (= ((fn [x done]
(if done
done
@@ -588,18 +586,16 @@
:else :a4))) [2] false)
:a2)))
-;; FAILS
-#_(deftest match-order-7
+(deftest match-order-7
(is (= (match [[2]]
[1] :a0
[[1]] :a1
[2] :a2
[[2]] :a3
:else :a4)
- :a3)))
+ :a3)))
-;; MATCH-43
-#_(deftest match-order-8
+(deftest match-order-8
(is (= (let [xs [:c]]
(match xs
[:a] :a0

0 comments on commit b2ee29d

Please sign in to comment.
Something went wrong with that request. Please try again.