Skip to content

Commit d8ff142

Browse files
committed
Add some 'column mode' tests, may remove this idea
1 parent 45c0e72 commit d8ff142

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/com/wotbrew/cinq/group_test.clj

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(ns com.wotbrew.cinq.group-test
2+
(:require [clojure.test :refer :all]
3+
[com.wotbrew.cinq :as c]
4+
[com.wotbrew.cinq.column]))
5+
6+
(deftest accessible-as-coll-test
7+
(is (= [1 2 3] (c/rel-first (c/q [a [1 2 3] :group []] (vec a)))))
8+
(is (= [[1 3] [2]] (vec (c/q [a [1 2 3] :group [even (even? a)] :order [even :asc]] (vec a))))))
9+
10+
(deftest type-is-column-test
11+
(is (instance? com.wotbrew.cinq.column.Column (c/rel-first (c/q [a [] :group []] a)))))
12+
13+
(deftest can-mix-aggregate-col-test
14+
(is (= [[1 2 3] 6] (c/rel-first (c/q [a [1 2 3] :group []] [(vec a) (c/sum a)])))))
15+

0 commit comments

Comments
 (0)