|
126 | 126 | (is (= pokemons (sort-by :national_no (r/run (-> (r/table test-table)
|
127 | 127 | (r/between r/minval r/maxval {:right-bound :closed})) conn))))
|
128 | 128 | (is (= (r/run (-> (r/table test-table)
|
129 |
| - (r/between 80 81 {:right-bound :closed})) conn) [(last pokemons)])) |
| 129 | + (r/between 80 81 {:right-bound :closed})) conn) [(last pokemons)])) |
130 | 130 | (is (= (r/run (-> (r/db test-db)
|
131 | 131 | (r/table test-table)
|
132 | 132 | (r/filter (r/fn [row]
|
|
231 | 231 |
|
232 | 232 | (deftest dates-and-times
|
233 | 233 | (with-open [conn (r/connect)]
|
| 234 | + (is (< (-> (t/interval (r/run (r/now) conn) (t/now)) |
| 235 | + (t/in-seconds)) |
| 236 | + 1)) |
| 237 | + |
234 | 238 | (are [term result] (= (r/run term conn) result)
|
235 | 239 | (r/time 2014 12 31) (t/date-time 2014 12 31)
|
236 | 240 | (r/time 2014 12 31 "+01:00") (t/from-time-zone
|
|
345 | 349 |
|
346 | 350 | (deftest geospatial-commands
|
347 | 351 | (with-open [conn (r/connect)]
|
348 |
| - (is (= {:type "Point" :coordinates [50 50]} |
349 |
| - (r/run (r/geojson {:type "Point" :coordinates [50 50]}) conn))) |
350 |
| - (is (= "Polygon" (:type (r/run (r/fill (r/line [[50 51] [51 51] [51 52] [50 51]])) conn)))) |
351 |
| - (is (= 104644.93094219 (r/run (r/distance (r/point 20 20) |
352 |
| - (r/circle (r/point 21 20) 2)) conn))))) |
| 352 | + (are [term result] (= (r/run term conn) result) |
| 353 | + (r/geojson {:type "Point" :coordinates [50 50]}) {:type "Point" :coordinates [50 50]} |
| 354 | + (r/fill (r/line [[50 51] [51 51] [51 52] [50 51]])) {:type "Polygon" :coordinates [[[50 51] [51 51] [51 52] [50 51]]]} |
| 355 | + (r/distance (r/point 20 20) (r/circle (r/point 21 20) 2)) 104644.93094219 |
| 356 | + (r/to-geojson (r/point 20 20)) {:type "Point" :coordinates [20 20]} |
| 357 | + (r/includes (r/circle (r/point 20 20) 2) (r/point 20 20)) true |
| 358 | + (r/includes (r/circle (r/point 20 20) 1) (r/point 40 40)) false |
| 359 | + (r/intersects (r/circle (r/point 20 20) 30) (r/point 21 20)) false |
| 360 | + (r/intersects (r/circle (r/point 20 20) 10) (r/point 20 20)) true |
| 361 | + (r/intersects (r/circle (r/point 20 20) 3) (r/circle (r/point 20 20) 1)) true |
| 362 | + (r/intersects (r/circle (r/point 20 20) 3) (r/circle (r/point 21 20) 1)) false |
| 363 | + (r/polygon [[50 51] [51 51] [51 52] [50 51]]) {:type "Polygon" :coordinates [[[50 51] [51 51] [51 52] [50 51]]]} |
| 364 | + (r/polygon-sub (r/polygon [[0 9] [0 6] [3 6] [3 9]]) |
| 365 | + (r/polygon [[1 7] [1 8] [2 8] [2 7]])) {:type "Polygon" :coordinates [[[0 9] [0 6] [3 6] [3 9] [0 9]] [[1 7] [1 8] [2 8] [2 7] [1 7]]]}))) |
353 | 366 |
|
354 | 367 | (deftest administration
|
355 | 368 | (with-open [conn (r/connect :db test-db)]
|
|
477 | 490 | (is (= ""
|
478 | 491 | (:auth-key (ex-data e)))))))
|
479 | 492 |
|
480 |
| - |
481 | 493 | (deftest utf8-compliance
|
482 | 494 | (with-open [conn (r/connect :db test-db)]
|
483 | 495 | (let [doc {:national_no (UUID/randomUUID)
|
|
0 commit comments