Skip to content

Commit

Permalink
Add more varied tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Gordon committed Jun 10, 2012
1 parent 7047797 commit b9f0e11
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/rotary/test/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
; hash-key 22, range-key 1339202640
; hash-key 25, range-key 1339202645

(def value1 13392)

(deftest query-with-range-key-can-find-rows
(is (count (query aws-credential test-table 25 `(> 1339))) 1))

Expand All @@ -20,7 +22,7 @@
(is (count (query aws-credential test-table 22 `(> 1339202642))) 1))

(deftest query-with-range-key-can-handle-less-than
(is (count (query aws-credential test-table 22 `(< 1339202642))) 1))
(is (count (query aws-credential test-table 22 [:< 1339202642])) 1))

(deftest query-with-range-key-less-than
(is (count (query aws-credential test-table 22 `(< 1339202640))) 0))
Expand All @@ -29,16 +31,16 @@
(is (query aws-credential test-table 22 `(<= 1339202640) {:count true}) 1))

(deftest query-with-range-key-can-handle-greater-than-with-multiple-items
(is (query aws-credential test-table 22 `(> 13392) {:count true}) 2))
(is (query aws-credential test-table 22 `(> ~value1) {:count true}) 2))

(deftest query-with-range-key-can-handle-greater-than-with-multiple-items-and-limit
(is (query aws-credential test-table 22 `(> 13392) {:count true :limit 1}) 1))
(is (query aws-credential test-table 22 `(> ~value1) {:count true :limit 1}) 1))

(deftest query-with-range-key-can-exclude-with-between
(is (count (query aws-credential test-table 22 `("BETWEEN" 13392 13399))) 0))
(is (count (query aws-credential test-table 22 `(between ~value1 13399))) 0))

(deftest query-with-range-key-can-include-with-between
(is (count (query aws-credential test-table 22 `("BETWEEN" 13392 999999999))) 2))
(is (count (query aws-credential test-table 22 `(between ~value1 999999999))) 2))

(deftest query-with-range-key-can-include-and-exclude-with-between
(is (count (query aws-credential test-table 22 `("BETWEEN" 13392 1339202643))) 1))
(is (count (query aws-credential test-table 22 [:between value1 1339202643])) 1))

0 comments on commit b9f0e11

Please sign in to comment.