Skip to content

Commit 72952bf

Browse files
author
dnolen
committed
fix bug in op-describe for ::pcat case, tests now pass
1 parent 73ad974 commit 72952bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/cljs/cljs/spec.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@
953953
::amp (list* 'clojure.spec/& (op-describe p1) forms)
954954
::pcat (if rep+
955955
(list `+ rep+)
956-
(cons `cat (mapcat vector (c/or (seq ks) (repeat :_)) (c/or (seq forms) (repeat nil)))))
956+
(cons `cat (mapcat vector (c/or (seq ks) (repeat :_)) forms)))
957957
::alt (if maybe
958958
(list `? maybe)
959959
(cons `alt (mapcat vector ks forms)))

src/test/cljs/cljs/spec_test.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
c ["s" :k 5] ::s/invalid '[{:reason "Extra input", :pred (cat :a string? :b keyword?), :val (5)}]
135135

136136
(s/cat) nil {} nil
137-
;(s/cat) [5] ::s/invalid '[{:reason "Extra input", :pred (cat), :val (5), :in [0]}]
137+
(s/cat) [5] ::s/invalid '[{:reason "Extra input", :pred (cat), :val (5), :in [0]}]
138138

139139
either nil ::s/invalid '[{:reason "Insufficient input", :pred (alt :a string? :b keyword?), :val () :via []}]
140140
either [] ::s/invalid '[{:reason "Insufficient input", :pred (alt :a string? :b keyword?), :val () :via []}]

0 commit comments

Comments
 (0)