From 5757a7bddcff1fb625ce521054e8d2c8a2fa7b1b Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:35:37 -0500 Subject: [PATCH 01/14] Convert `<=` arity 1 tests to use `are` --- test/clojure/core_test/lt_eq.cljc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/clojure/core_test/lt_eq.cljc b/test/clojure/core_test/lt_eq.cljc index c2ade916..36031892 100644 --- a/test/clojure/core_test/lt_eq.cljc +++ b/test/clojure/core_test/lt_eq.cljc @@ -5,15 +5,16 @@ (when-var-exists <= (deftest test-<= (testing "arity 1" - ;; Doesn't matter what the argument is, `<=` return `true` for - ;; one argument. - (is (<= 1)) - (is (<= 0)) - (is (<= -1)) - ;; Doesn't check whether arg is a number - (is (<= "abc")) - (is (<= :foo)) - (is (<= nil))) + (are [x] (= true (<= x)) + ;; Doesn't matter what the argument is, `>=` return `true` for + ;; one argument. + 1 + 0 + -1 + ;; Doesn't check whether the argument is a number + "abc" + :foo + nil)) (testing "arity 2" (are [expected x y] (= expected (<= x y)) From 7cde844d14ea170e9b7ae8f2f6933f12b498b8ef Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:36:01 -0500 Subject: [PATCH 02/14] Add `<=` test for five equal numbers --- test/clojure/core_test/lt_eq.cljc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/clojure/core_test/lt_eq.cljc b/test/clojure/core_test/lt_eq.cljc index 36031892..e6d52c48 100644 --- a/test/clojure/core_test/lt_eq.cljc +++ b/test/clojure/core_test/lt_eq.cljc @@ -89,7 +89,8 @@ false ##Inf 0 ##-Inf) (is (= true (apply <= (range 10)))) (is (= true (apply <= 0 (range 10)))) - (is (= false (apply <= 100 (range 10))))) + (is (= false (apply <= 100 (range 10)))) + (is (= true (apply <= (repeat 5 1))))) (testing "negative tests" ;; `<=` only compares numbers, except in ClojureScript (really From c51bc550f2b4cc5819d72c6a4bdae15d6c4470fa Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:36:35 -0500 Subject: [PATCH 03/14] Remove some negative tests outside the function contract --- test/clojure/core_test/lt_eq.cljc | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/test/clojure/core_test/lt_eq.cljc b/test/clojure/core_test/lt_eq.cljc index e6d52c48..85e29dc4 100644 --- a/test/clojure/core_test/lt_eq.cljc +++ b/test/clojure/core_test/lt_eq.cljc @@ -100,31 +100,19 @@ [(is (= true (<= nil 1))) (is (= false (<= 1 nil))) (is (= true (<= nil 1 2))) - (is (= false (<= 1 2 nil))) - (is (= true (<= "1" "2"))) - (is (= false (<= "foo" "bar"))) - (is (= false (<= :foo :bar)))] + (is (= false (<= 1 2 nil)))] :cljr [(is (p/thrown? (<= nil 1))) (is (p/thrown? (<= 1 nil))) (is (p/thrown? (<= nil 1 2))) - (is (p/thrown? (<= 1 2 nil))) - (is (= true (<= "1" "2"))) - (is (p/thrown? (<= "foo" "bar"))) - (is (p/thrown? (<= :foo :bar)))] + (is (p/thrown? (<= 1 2 nil)))] :lpy [(is (p/thrown? (<= nil 1))) (is (p/thrown? (<= 1 nil))) (is (p/thrown? (<= nil 1 2))) - (is (p/thrown? (<= 1 2 nil))) - (is (= true (<= "1" "2"))) - (is (= false (<= "foo" "bar"))) - (is (= false (<= :foo :bar)))] + (is (p/thrown? (<= 1 2 nil)))] :default [(is (p/thrown? (<= nil 1))) (is (p/thrown? (<= 1 nil))) (is (p/thrown? (<= nil 1 2))) - (is (p/thrown? (<= 1 2 nil))) - (is (p/thrown? (<= "1" "2"))) - (is (p/thrown? (<= "foo" "bar"))) - (is (p/thrown? (<= :foo :bar)))])))) + (is (p/thrown? (<= 1 2 nil)))])))) From 4f89c061ccae0e483cf8294013570a6868f7205d Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:38:42 -0500 Subject: [PATCH 04/14] Fix comment --- test/clojure/core_test/lt_eq.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/clojure/core_test/lt_eq.cljc b/test/clojure/core_test/lt_eq.cljc index 85e29dc4..2f148a5a 100644 --- a/test/clojure/core_test/lt_eq.cljc +++ b/test/clojure/core_test/lt_eq.cljc @@ -6,7 +6,7 @@ (deftest test-<= (testing "arity 1" (are [x] (= true (<= x)) - ;; Doesn't matter what the argument is, `>=` return `true` for + ;; Doesn't matter what the argument is, `<=` return `true` for ;; one argument. 1 0 From 170b5ab10dc5b3f3417d6ecb39759285464b0763 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:45:56 -0500 Subject: [PATCH 05/14] Convert `<` arity 1 tests to use `are` --- test/clojure/core_test/lt.cljc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/clojure/core_test/lt.cljc b/test/clojure/core_test/lt.cljc index 5ec33ea0..af099fb8 100644 --- a/test/clojure/core_test/lt.cljc +++ b/test/clojure/core_test/lt.cljc @@ -5,15 +5,16 @@ (when-var-exists < (deftest test-< (testing "arity 1" - ;; Doesn't matter what the argument is, `<` return `true` for - ;; one argument. - (is (< 1)) - (is (< 0)) - (is (< -1)) - ;; Doesn't check whether arg is a number - (is (< "abc")) - (is (< :foo)) - (is (< nil))) + (are [x] (= true (< x)) + ;; Doesn't matter what the argument is, `<` return `true` for + ;; one argument. + 1 + 0 + -1 + ;; Doesn't check whether the argument is a number + "abc" + :foo + nil)) (testing "arity 2" (are [expected x y] (= expected (< x y)) From 32cbb28ebb6f6eca2d8af257e4608112a6dd0902 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:46:21 -0500 Subject: [PATCH 06/14] Add some tests of equal rationals to `<` --- test/clojure/core_test/lt.cljc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/clojure/core_test/lt.cljc b/test/clojure/core_test/lt.cljc index af099fb8..d32ddf46 100644 --- a/test/clojure/core_test/lt.cljc +++ b/test/clojure/core_test/lt.cljc @@ -67,7 +67,11 @@ false 1/2 1/16 false 0.5 1/16 false -1/16 -1/2 - false -1/16 -0.5)))) + false -1/16 -0.5 + false 1/2 1/2 + false 1/3 1/3 + false -1/2 -1/2 + false -1/3 -1/3)))) (testing "arity 3 and more" (are [expected x y z] (= expected (< x y z)) From 0e199ac0f0bf95d00b0bdb64143eab9c108b9b89 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:46:53 -0500 Subject: [PATCH 07/14] Add test of five equal numbers to `<` --- test/clojure/core_test/lt.cljc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/clojure/core_test/lt.cljc b/test/clojure/core_test/lt.cljc index d32ddf46..b62dfc1d 100644 --- a/test/clojure/core_test/lt.cljc +++ b/test/clojure/core_test/lt.cljc @@ -83,7 +83,8 @@ false 0 -2 -1 false -2 0 -1) (is (= true (apply < (range 10)))) - (is (= false (apply < 100 (range 10))))) + (is (= false (apply < 100 (range 10)))) + (is (= false (apply < (repeat 5 1))))) (testing "negative tests" ;; `<` only compares numbers, except in ClojureScript (really From 4e6c77a0b8aadc9624060109572bd6d623b25dbe Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:49:02 -0500 Subject: [PATCH 08/14] Convert `>` arity 1 tests to use `are` --- test/clojure/core_test/gt.cljc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/clojure/core_test/gt.cljc b/test/clojure/core_test/gt.cljc index ea07835e..61e39bd4 100644 --- a/test/clojure/core_test/gt.cljc +++ b/test/clojure/core_test/gt.cljc @@ -5,15 +5,16 @@ (when-var-exists > (deftest test-> (testing "arity 1" - ;; Doesn't matter what the argument is, `>` return `true` for - ;; one argument. - (is (> 1)) - (is (> 0)) - (is (> -1)) - ;; Doesn't check whether arg is a number - (is (> "abc")) - (is (> :foo)) - (is (> nil))) + (are [x] (= true (> x)) + ;; Doesn't matter what the argument is, `>` return `true` for + ;; one argument. + 1 + 0 + -1 + ;; Doesn't check whether the argument is a number + "abc" + :foo + nil)) (testing "arity 2" (are [expected x y] (= expected (> x y)) From 1278f0df7df2b3e3a9f9a852cb3b19e7284fb1c4 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:51:07 -0500 Subject: [PATCH 09/14] Fix spacing --- test/clojure/core_test/gt.cljc | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/clojure/core_test/gt.cljc b/test/clojure/core_test/gt.cljc index 61e39bd4..3fe0bd78 100644 --- a/test/clojure/core_test/gt.cljc +++ b/test/clojure/core_test/gt.cljc @@ -19,26 +19,26 @@ (testing "arity 2" (are [expected x y] (= expected (> x y)) true 1 0 - true 0 -1 - true 1N 0N - true 0N -1N - true 1.0 0.0 - true 0.0 -1.0 - true 1.0M 0.0M - true 0.0M -1.0M - true -1 ##-Inf - true ##Inf 1 + true 0 -1 + true 1N 0N + true 0N -1N + true 1.0 0.0 + true 0.0 -1.0 + true 1.0M 0.0M + true 0.0M -1.0M + true -1 ##-Inf + true ##Inf 1 false 0 1 - false -1 0 - false 0N 1N - false -1N 0N - false 0.0 1.0 - false -1.0 0.0 - false 0.0M 1.0M - false -1.0M 0.0M - false ##-Inf -1 - false 1 ##Inf + false -1 0 + false 0N 1N + false -1N 0N + false 0.0 1.0 + false -1.0 0.0 + false 0.0M 1.0M + false -1.0M 0.0M + false ##-Inf -1 + false 1 ##Inf false 1 ##NaN ; Anything compared with ##NaN is false false ##NaN 1 @@ -62,14 +62,14 @@ (testing "Rationals" (are [expected x y] (= expected (> x y)) true 1/2 1/16 - true 0.5 1/16 - true -1/16 -1/2 - true -1/16 -0.5 + true 0.5 1/16 + true -1/16 -1/2 + true -1/16 -0.5 false 1/16 1/2 - false -1/2 -1/16 - false 1/16 0.5 - false -0.5 -1/16)))) + false -1/2 -1/16 + false 1/16 0.5 + false -0.5 -1/16)))) (testing "arity 3 and more" (are [expected x y z] (= expected (> x y z)) From c9a0198b27292da2655704b332a39ce4494e2a65 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:55:27 -0500 Subject: [PATCH 10/14] Add some tests of equal rationals to `>` --- test/clojure/core_test/gt.cljc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/clojure/core_test/gt.cljc b/test/clojure/core_test/gt.cljc index 3fe0bd78..0004fbc1 100644 --- a/test/clojure/core_test/gt.cljc +++ b/test/clojure/core_test/gt.cljc @@ -61,15 +61,18 @@ :default (testing "Rationals" (are [expected x y] (= expected (> x y)) + false 1/16 1/2 + false -1/2 -1/16 + false 1/16 0.5 + false -0.5 -1/16 true 1/2 1/16 true 0.5 1/16 true -1/16 -1/2 true -1/16 -0.5 - - false 1/16 1/2 - false -1/2 -1/16 - false 1/16 0.5 - false -0.5 -1/16)))) + false 1/2 1/2 + false 1/3 1/3 + false -1/2 -1/2 + false -1/3 -1/3)))) (testing "arity 3 and more" (are [expected x y z] (= expected (> x y z)) From 9f4702accb74807c75b1c768ad915fadc22fd756 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:56:56 -0500 Subject: [PATCH 11/14] Add test of five equal numbers to `>` --- test/clojure/core_test/gt.cljc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/clojure/core_test/gt.cljc b/test/clojure/core_test/gt.cljc index 0004fbc1..866b239c 100644 --- a/test/clojure/core_test/gt.cljc +++ b/test/clojure/core_test/gt.cljc @@ -84,7 +84,8 @@ false -1 -2 0 false -1 0 -2) (is (= true (apply > (reverse (range 10))))) - (is (= false (apply > -1 (reverse (range 10)))))) + (is (= false (apply > -1 (reverse (range 10))))) + (is (= false (apply < (repeat 5 1))))) (testing "negative tests" ;; `>` only compares numbers, except in ClojureScript (really From 3a483e421dd6956d5a2fd9873358d067fad399fc Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 13:58:57 -0500 Subject: [PATCH 12/14] Remove neg tests from outside the function contracts of `<` and `>` --- test/clojure/core_test/gt.cljc | 20 ++++---------------- test/clojure/core_test/lt.cljc | 20 ++++---------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/test/clojure/core_test/gt.cljc b/test/clojure/core_test/gt.cljc index 866b239c..5dd10636 100644 --- a/test/clojure/core_test/gt.cljc +++ b/test/clojure/core_test/gt.cljc @@ -96,31 +96,19 @@ [(is (= true (> 1 nil))) (is (= false (> nil 1))) (is (= true (> 2 1 nil))) - (is (= false (> 1 2 nil))) - (is (= true (> "2" "1"))) - (is (= false (> "bar" "foo"))) - (is (= false (> :bar :foo)))] + (is (= false (> 1 2 nil)))] :cljr [(is (p/thrown? (> 1 nil))) (is (p/thrown? (> nil 1))) (is (p/thrown? (> 1 nil 2))) - (is (p/thrown? (> 2 1 nil))) - (is (= true (> "2" "1"))) - (is (p/thrown? (> "bar" "foo"))) - (is (p/thrown? (> :bar :foo)))] + (is (p/thrown? (> 2 1 nil)))] :lpy [(is (p/thrown? (> 1 nil))) (is (p/thrown? (> nil 1))) (is (p/thrown? (> 1 nil 2))) - (is (p/thrown? (> 2 1 nil))) - (is (= true (> "2" "1"))) - (is (= false (> "bar" "foo"))) - (is (= false (> :bar :foo)))] + (is (p/thrown? (> 2 1 nil)))] :default [(is (p/thrown? (> 1 nil))) (is (p/thrown? (> nil 1))) (is (p/thrown? (> 1 nil 2))) - (is (p/thrown? (> 2 1 nil))) - (is (p/thrown? (> "2" "1"))) - (is (p/thrown? (> "bar" "foo"))) - (is (p/thrown? (> :bar :foo)))])))) + (is (p/thrown? (> 2 1 nil)))])))) diff --git a/test/clojure/core_test/lt.cljc b/test/clojure/core_test/lt.cljc index b62dfc1d..3c36d952 100644 --- a/test/clojure/core_test/lt.cljc +++ b/test/clojure/core_test/lt.cljc @@ -94,31 +94,19 @@ [(is (= true (< nil 1))) (is (= false (< 1 nil))) (is (= true (< nil 1 2))) - (is (= false (< 1 2 nil))) - (is (= true (< "1" "2"))) - (is (= false (< "foo" "bar"))) - (is (= false (< :foo :bar)))] + (is (= false (< 1 2 nil)))] :cljr [(is (p/thrown? (< nil 1))) (is (p/thrown? (< 1 nil))) (is (p/thrown? (< nil 1 2))) - (is (p/thrown? (< 1 2 nil))) - (is (= true (< "1" "2"))) - (is (p/thrown? (< "foo" "bar"))) - (is (p/thrown? (< :foo :bar)))] + (is (p/thrown? (< 1 2 nil)))] :lpy [(is (p/thrown? (< nil 1))) (is (p/thrown? (< 1 nil))) (is (p/thrown? (< nil 1 2))) - (is (p/thrown? (< 1 2 nil))) - (is (= true (< "1" "2"))) - (is (= false (< "foo" "bar"))) - (is (= false (< :foo :bar)))] + (is (p/thrown? (< 1 2 nil)))] :default [(is (p/thrown? (< nil 1))) (is (p/thrown? (< 1 nil))) (is (p/thrown? (< nil 1 2))) - (is (p/thrown? (< 1 2 nil))) - (is (p/thrown? (< "1" "2"))) - (is (p/thrown? (< "foo" "bar"))) - (is (p/thrown? (< :foo :bar)))])))) + (is (p/thrown? (< 1 2 nil)))])))) From fd794c1d7dc4668209b2af0eea56bf02beaf0547 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 14:49:09 -0500 Subject: [PATCH 13/14] Fix comment grammar Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- test/clojure/core_test/lt_eq.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/clojure/core_test/lt_eq.cljc b/test/clojure/core_test/lt_eq.cljc index 2f148a5a..2225c1fc 100644 --- a/test/clojure/core_test/lt_eq.cljc +++ b/test/clojure/core_test/lt_eq.cljc @@ -6,7 +6,7 @@ (deftest test-<= (testing "arity 1" (are [x] (= true (<= x)) - ;; Doesn't matter what the argument is, `<=` return `true` for + ;; Doesn't matter what the argument is, `<=` returns `true` for ;; one argument. 1 0 From 05099632f7fc9a5848d7f34b772b465a856432a4 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Tue, 21 Apr 2026 15:01:36 -0500 Subject: [PATCH 14/14] Fix grammar in comments and one bug caught by CoPilot review --- test/clojure/core_test/gt.cljc | 4 ++-- test/clojure/core_test/lt.cljc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/clojure/core_test/gt.cljc b/test/clojure/core_test/gt.cljc index 5dd10636..387ae177 100644 --- a/test/clojure/core_test/gt.cljc +++ b/test/clojure/core_test/gt.cljc @@ -6,7 +6,7 @@ (deftest test-> (testing "arity 1" (are [x] (= true (> x)) - ;; Doesn't matter what the argument is, `>` return `true` for + ;; Doesn't matter what the argument is, `>` returns `true` for ;; one argument. 1 0 @@ -85,7 +85,7 @@ false -1 0 -2) (is (= true (apply > (reverse (range 10))))) (is (= false (apply > -1 (reverse (range 10))))) - (is (= false (apply < (repeat 5 1))))) + (is (= false (apply > (repeat 5 1))))) (testing "negative tests" ;; `>` only compares numbers, except in ClojureScript (really diff --git a/test/clojure/core_test/lt.cljc b/test/clojure/core_test/lt.cljc index 3c36d952..baca4c12 100644 --- a/test/clojure/core_test/lt.cljc +++ b/test/clojure/core_test/lt.cljc @@ -6,7 +6,7 @@ (deftest test-< (testing "arity 1" (are [x] (= true (< x)) - ;; Doesn't matter what the argument is, `<` return `true` for + ;; Doesn't matter what the argument is, `<` returns `true` for ;; one argument. 1 0