Skip to content

Commit 42ce74d

Browse files
committed
Enable print tests in bb
1 parent 372c838 commit 42ce74d

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

test/lambdaisland/deep_diff2/printer_test.cljc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
#?(:clj
66
(:import (java.sql Timestamp)
77
(java.util Date
8-
GregorianCalendar
98
TimeZone))))
109

10+
#?(:bb nil ;; GregorianCalender not included in favor of java.time
11+
:clj (import '[java.util GregorianCalendar]))
12+
1113
(defn- printed
1214
[diff]
1315
(let [printer (printer/puget-printer {})]
1416
(with-out-str (-> diff
1517
(printer/format-doc printer)
1618
(printer/print-doc printer)))))
17-
#?(:clj
19+
#?(:bb nil
20+
:clj
1821
(defn- calendar
1922
[date]
2023
(doto (GregorianCalendar. (TimeZone/getTimeZone "GMT"))
@@ -26,13 +29,15 @@
2629
(printed (diff/diff #inst "2019-04-09T14:57:46.128-00:00"
2730
#inst "2019-04-10T14:57:46.128-00:00")))))
2831

29-
#?(:clj
32+
#?(:bb nil ;; bb TimeStamp constructor not included as of 1.0.166
33+
:clj
3034
(testing "timestamp"
3135
(is (= "\u001B[31m-#inst \"1970-01-01T00:00:00.000000000-00:00\"\u001B[0m \u001B[32m+#inst \"1970-01-01T00:00:01.000000101-00:00\"\u001B[0m\n"
3236
(printed (diff/diff (Timestamp. 0)
3337
(doto (Timestamp. 1000) (.setNanos 101))))))))
3438

35-
#?(:clj
39+
#?(:bb nil
40+
:clj
3641
(testing "calendar"
3742
(is (= "\u001B[31m-#inst \"1970-01-01T00:00:00.000+00:00\"\u001B[0m \u001B[32m+#inst \"1970-01-01T00:00:01.001+00:00\"\u001B[0m\n"
3843
(printed (diff/diff (calendar (Date. 0)) (calendar (Date. 1001))))))))

test/lambdaisland/deep_diff2/runner.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
(defn run-tests [_]
66
(let [test-nss '[lambdaisland.deep-diff2.diff-test
7-
#_lambdaisland.deep-diff2.printer-test
7+
lambdaisland.deep-diff2.printer-test
88
lambdaisland.deep-diff2.puget-test]]
99
(doseq [test-ns test-nss]
1010
(require test-ns))

0 commit comments

Comments
 (0)