Skip to content

Commit

Permalink
Upgraded planck, fixed cljs tests for new cljs. Issue #222.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkinnear committed Mar 24, 2022
1 parent a105fe8 commit 8918b21
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:deps {#_#_org.clojure/clojure {:mvn/version "1.9.0"},
#_#_org.clojure/clojurescript {:mvn/version "1.9.946"},
#_#_org.clojure/clojure {:mvn/version "1.10.3"},
org.babashka/sci {:mvn/version "0.3.2"},
org.babashka/sci {:mvn/version #_"0.3.2" "0.2.8" #_"0.3.3"},
;; To use zprint with babashka, include the following dependency:
;; org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
;; :git/sha "1a841c4cc1d4f6dab7505a98ed2d532dd9d56b78"}
Expand Down
57 changes: 30 additions & 27 deletions test/zprint/zprint_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -5820,16 +5820,18 @@ ser/collect-vars-acc %1 %2) )))"
;; and :map {:key-no-sort ...}
;;

#?(:clj
(expect
"java.lang.Exception: Unable to parse the string '[{k 1 g 2 c 3 aaa}]' because of 'java.lang.IllegalArgumentException: No value supplied for key: aaa'. Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}"
(try (zprint-str "[{k 1 g 2 c 3 aaa}]"
{:parse-string? true, :style :odr})
(catch Exception e (str e))))
:cljs (expect "[{aaa, c 3, g 2, k 1}]"
(try (zprint-str "[{k 1 g 2 c 3 aaa}]"
{:parse-string? true, :style :odr})
(catch :default e (str e)))))
#?(:clj
(expect
"java.lang.Exception: Unable to parse the string '[{k 1 g 2 c 3 aaa}]' because of 'java.lang.IllegalArgumentException: No value supplied for key: aaa'. Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}"
(try (zprint-str "[{k 1 g 2 c 3 aaa}]"
{:parse-string? true, :style :odr})
(catch Exception e (str e))))
:cljs
(expect
"Error: Unable to parse the string '[{k 1 g 2 c 3 aaa}]' because of 'Error: No value supplied for key: aaa'. Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}"
(try (zprint-str "[{k 1 g 2 c 3 aaa}]"
{:parse-string? true, :style :odr})
(catch :default e (str e)))))

(expect "[{aaa, c 3, g 2, k 1}]"
(zprint-str "[{k 1 g 2 c 3 aaa}]"
Expand Down Expand Up @@ -5860,23 +5862,24 @@ ser/collect-vars-acc %1 %2) )))"
:remove {:map {:key-no-sort #{"..."}}},
:style :odr}))

#?(:clj
(expect
"java.lang.Exception: Unable to parse the string '[{:a 1 :b 2 ...}]' because of 'java.lang.IllegalArgumentException: No value supplied for key: ...'. Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}"
(try (zprint-str vbm
{:parse-string? true,
:remove {:map {:key-no-sort #{"..."}},
:parse {:ignore-if-parse-fails #{"..."}}},
:style :odr})
(catch Exception e (str e))))
:cljs (expect "[{..., :a 1, :b 2}]"
(try (zprint-str
vbm
{:parse-string? true,
:remove {:map {:key-no-sort #{"..."}},
:parse {:ignore-if-parse-fails #{"..."}}},
:style :odr})
(catch :default e (str e)))))
#?(:clj
(expect
"java.lang.Exception: Unable to parse the string '[{:a 1 :b 2 ...}]' because of 'java.lang.IllegalArgumentException: No value supplied for key: ...'. Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}"
(try (zprint-str vbm
{:parse-string? true,
:remove {:map {:key-no-sort #{"..."}},
:parse {:ignore-if-parse-fails #{"..."}}},
:style :odr})
(catch Exception e (str e))))
:cljs
(expect
"Error: Unable to parse the string '[{:a 1 :b 2 ...}]' because of 'Error: No value supplied for key: ...'. Consider adding any unallowed elements to {:parse {:ignore-if-parse-fails #{ <string> }}}"
(try (zprint-str vbm
{:parse-string? true,
:remove {:map {:key-no-sort #{"..."}},
:parse {:ignore-if-parse-fails #{"..."}}},
:style :odr})
(catch :default e (str e)))))

;;
;; Lots of #188 issue with "..."
Expand Down

0 comments on commit 8918b21

Please sign in to comment.