From 0168ada45d9e6c8641df85f7d55853a084a20789 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 26 Sep 2022 11:56:39 +0200 Subject: [PATCH] Fix zero leading number with quotes (#54) Closes #35 --- deps.edn | 2 +- project.clj | 2 +- test/clj_yaml/core_test.clj | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/deps.edn b/deps.edn index 90464c7..e72558c 100644 --- a/deps.edn +++ b/deps.edn @@ -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 diff --git a/project.clj b/project.clj index eaa28be..cd76773 100644 --- a/project.clj +++ b/project.clj @@ -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"]]}}) diff --git a/test/clj_yaml/core_test.clj b/test/clj_yaml/core_test.clj index 98b1310..51d93a2 100644 --- a/test/clj_yaml/core_test.clj +++ b/test/clj_yaml/core_test.clj @@ -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 @@ -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"])))))) +