From a5ff26f60270689369bda7a54beabb44f8998b0a Mon Sep 17 00:00:00 2001 From: primo-ppcg Date: Fri, 8 Sep 2023 16:30:44 +0700 Subject: [PATCH] add more test cases for `partition` and `mean` --- test/suite-boot.janet | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/suite-boot.janet b/test/suite-boot.janet index 49f5ee03..61bc6c6b 100644 --- a/test/suite-boot.janet +++ b/test/suite-boot.janet @@ -349,6 +349,13 @@ "sort 5") (assert (<= ;(sort (map (fn [x] (math/random)) (range 1000)))) "sort 6") +# #1283 +(assert (deep= + (partition 2 (generate [ i :in [:a :b :c :d :e]] i)) + '@[(:a :b) (:c :d) (:e)])) +(assert (= (mean (generate [i :in [2 3 5 7 11]] i)) + 5.6)) + # And and or # c16a9d846 (assert (= (and true true) true) "and true true")