Permalink
Browse files

Add test for zinterstore

  • Loading branch information...
1 parent 1ed62e5 commit 7cbb980bf65fa0db78dfa8dfe9520c94d841b2c4 @travis travis committed Mar 21, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 test/accession/test/core.clj
View
9 test/accession/test/core.clj
@@ -151,15 +151,22 @@
(redis/with-connection c (redis/zadd "hackers" "1916" "Claude Shannon"))
(redis/with-connection c (redis/zadd "hackers" "1969" "Linus Torvalds"))
(redis/with-connection c (redis/zadd "hackers" "1912" "Alan Turing"))
+ (redis/with-connection c (redis/zadd "hackers" "1972" "Dade Murphy"))
+ (redis/with-connection c (redis/zadd "hackers" "1970" "Emmanuel Goldstein"))
(redis/with-connection c (redis/zadd "slackers" "1968" "Pauly Shore"))
+ (redis/with-connection c (redis/zadd "slackers" "1972" "Dade Murphy"))
+ (redis/with-connection c (redis/zadd "slackers" "1970" "Emmanuel Goldstein"))
(redis/with-connection c (redis/zadd "slackers" "1966" "Adam Sandler"))
(redis/with-connection c (redis/zadd "slackers" "1962" "Ferris Beuler"))
(redis/with-connection c (redis/zadd "slackers" "1871" "Theodore Dreiser"))
(redis/with-connection c (redis/zunionstore "hackersnslackers" ["hackers" "slackers"]))
+ (redis/with-connection c (redis/zinterstore "hackerslackers" ["hackers" "slackers"]))
(is (= (quote ("Alan Kay" "Richard Stallman" "Yukihiro Matsumoto"))
(redis/with-connection c (redis/zrange "hackers" "2" "4"))))
(is (= (quote ("Claude Shannon" "Alan Kay" "Richard Stallman" "Ferris Beuler"))
- (redis/with-connection c (redis/zrange "hackersnslackers" "2" "5")))))
+ (redis/with-connection c (redis/zrange "hackersnslackers" "2" "5"))))
+ (is (= (quote ("Emmanuel Goldstein" "Dade Murphy"))
+ (redis/with-connection c (redis/zrange "hackerslackers" "0" "1")))))
(deftest test-dbsize
(redis/with-connection c (redis/flushdb))

0 comments on commit 7cbb980

Please sign in to comment.