Skip to content

Commit

Permalink
Fix zero leading number with quotes (#54)
Browse files Browse the repository at this point in the history
Closes #35
  • Loading branch information
borkdude authored Sep 26, 2022
1 parent e7bcbd4 commit 0168ada
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{:paths ["src/clojure" "target/classes"]
:deps {org.yaml/snakeyaml {:mvn/version "1.32"}
:deps {org.yaml/snakeyaml {:mvn/version "1.33"}
org.flatland/ordered {:mvn/version "1.5.9"}}
:deps/prep-lib {:alias :build
:fn compile-java
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
:java-source-paths ["src/java"]
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
:dependencies
[[org.yaml/snakeyaml "1.32"]
[[org.yaml/snakeyaml "1.33"]
[org.flatland/ordered "1.5.9"]]
:profiles {:provided {:dependencies [[org.clojure/clojure "1.10.1"]]}})
8 changes: 7 additions & 1 deletion test/clj_yaml/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
[clojure.java.io :as io]
[clojure.string :as string]
[clojure.test :refer (deftest testing is)]
[flatland.ordered.map :refer [ordered-map]])
[flatland.ordered.map :refer [ordered-map]]
[clojure.string :as str])
(:import
(java.io ByteArrayInputStream ByteArrayOutputStream OutputStreamWriter)
java.nio.charset.StandardCharsets
Expand Down Expand Up @@ -366,3 +367,8 @@ sequence: !CustomSequence
(if (= "!Base12" tag)
(Integer/parseInt value 12) value)))))))

(deftest leading-zero-test
(testing "leading zero is quoted"
(is (= "['083']"
(str/trim (generate-string ["083"]))))))

0 comments on commit 0168ada

Please sign in to comment.