Skip to content

Commit 5caf100

Browse files
authored
Merge pull request #37 from borkdude/enable-print-tests-in-bb
Enable print tests in bb
2 parents 372c838 + 5b28b91 commit 5caf100

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/bb.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
os: [ubuntu-latest, macOS-latest, windows-latest]
11+
os: [ubuntu-latest]
1212

1313
runs-on: ${{ matrix.os }}
1414

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Added
44

5+
- Enable print tests in babashka
6+
57
## Fixed
68

79
## Changed
@@ -144,4 +146,4 @@
144146

145147
## Added
146148

147-
- Extracted from Kaocha, and added a top-level namespace.
149+
- Extracted from Kaocha, and added a top-level namespace.

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)