|
12 | 12 | (map (fn [[k v]] {k v}) m)) |
13 | 13 |
|
14 | 14 | (def pokemons [{:national_no 25 |
15 | | - :name "Pikachu" |
16 | | - :type ["Electric"]} |
| 15 | + :name "Pikachu" |
| 16 | + :type ["Electric"]} |
17 | 17 | {:national_no 81 |
18 | | - :name "Magnemite" |
19 | | - :type ["Electric" "Steel"]}]) |
| 18 | + :name "Magnemite" |
| 19 | + :type ["Electric" "Steel"]}]) |
20 | 20 |
|
21 | 21 | (def bulbasaur {:national_no 1 |
22 | | - :name "Bulbasaur" |
23 | | - :type ["Grass" "Poison"]}) |
| 22 | + :name "Bulbasaur" |
| 23 | + :type ["Grass" "Poison"]}) |
24 | 24 |
|
25 | 25 | (defn ensure-table |
26 | 26 | "Ensures that an empty table \"table-name\" exists" |
|
220 | 220 |
|
221 | 221 | (deftest math-and-logic |
222 | 222 | (with-open [conn (r/connect)] |
223 | | - (is (< (r/run (r/random 0 2) conn) 2)) |
| 223 | + (is (<= 0 (r/run (r/random 0 2) conn) 2)) |
224 | 224 | (are [term result] (= (r/run term conn) result) |
225 | 225 | (r/add 2 2 2) 6 |
226 | 226 | (r/add "Hello " "from " "Tokyo") "Hello from Tokyo" |
227 | | - (r/add [1 2] [3 4]) [1 2 3 4]))) |
| 227 | + (r/add [1 2] [3 4]) [1 2 3 4]) |
| 228 | + |
| 229 | + (are [args lt-le-eq-ne-ge-gt] (= (r/run (r/make-array |
| 230 | + (apply r/lt args) |
| 231 | + (apply r/le args) |
| 232 | + (apply r/eq args) |
| 233 | + (apply r/ne args) |
| 234 | + (apply r/ge args) |
| 235 | + (apply r/gt args)) conn) |
| 236 | + lt-le-eq-ne-ge-gt) |
| 237 | + [1 1] [false true true false true false] |
| 238 | + [0 1] [true true false true false false] |
| 239 | + [0 1 2 3] [true true false true false false] |
| 240 | + [0 1 1 2] [false true false true false false] |
| 241 | + [5 4 3] [false false false true true true] |
| 242 | + [5 4 4 3] [false false false true true false]) |
| 243 | + |
| 244 | + (are [n floor-round-ceil] (= (r/run (r/make-array (r/floor n) (r/round n) (r/ceil n)) conn) floor-round-ceil) |
| 245 | + 0 [0 0 0] |
| 246 | + 0.1 [0 0 1] |
| 247 | + 1.499999999 [1 1 2] |
| 248 | + 1.5 [1 2 2] |
| 249 | + 1.5M [1 2 2] |
| 250 | + 3.99999999 [3 4 4] |
| 251 | + -5.1 [-6 -5 -5] |
| 252 | + 1/2 [0 1 1]))) |
228 | 253 |
|
229 | 254 | (deftest geospatial-commands |
230 | 255 | (with-open [conn (r/connect)] |
|
0 commit comments