Add tests for partition-by (#1795)

Co-authored-by: sogaiu <983021772@users.noreply.github.com>
Co-authored-by: Calvin Rose <calsrose@gmail.com>
This commit is contained in:
sogaiu
2026-08-15 12:05:01 -05:00
committed by GitHub
co-authored by sogaiu Calvin Rose
parent ffb6648742
commit 0888a6dfb0
+5
View File
@@ -1040,6 +1040,11 @@
(assert (deep= (frequencies (coro (yield 1) (yield 8) (yield 2) (yield 8)))
@{1 1 2 1 8 2}))
# partition-by
(assert (deep= (partition-by even? "hello")
@[@[104] @[101] @[108 108] @[111]]))
(assert (deep= (partition-by keyword? [:a "b" 'c :d])
@[@[:a] @["b" 'c] @[:d]]))
# update
(assert (deep= (update @"hello" 0 (fn [old delta] (+ old delta)) 17)
@"yello"))