Skip to content

Commit

Permalink
Have moved SISMEMBER to URP, and kicked smoke tests forward
Browse files Browse the repository at this point in the history
  • Loading branch information
rgeoghegan committed May 3, 2011
1 parent 1d0ec4a commit b687b3c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/redis.ml
Expand Up @@ -339,7 +339,7 @@ let scard key connection =
let sismember key member connection =
(* SISMEMBER *)
handle_integer_as_boolean
(send_with_value_and_receive_command_safely ("SISMEMBER " ^ key) member connection);;
(send_multibulk_and_receive_command_safely ["SISMEMBER"; key; member] connection);;

let smembers key connection =
(* SMEMBERS *)
Expand Down
10 changes: 4 additions & 6 deletions tests/smoke_test.ml
Expand Up @@ -95,23 +95,17 @@ let smoke_test_with_quit conn = begin
assert ( Redis.smove "tim" "rory" "even cooler" conn );
assert ( 2 = Redis.scard "rory" conn );

(* *)
assert ( Redis.sismember "rory" "cool" conn );

(*
ignore ( Redis.srem "rory" "cool" conn );
assert ( "even cooler" = Redis.string_of_bulk_data (List.hd (Redis.smembers "rory" conn)) );
*)
(*
ignore (Redis.sadd "tim" "even cooler" conn);
assert ( "even cooler" = Redis.string_of_bulk_data (List.hd (Redis.sinter ["rory"; "tim"] conn)) );

assert ( 1 = Redis.sinterstore "bob" ["rory"; "tim"] conn );

assert ( "even cooler" = Redis.string_of_bulk_data (List.hd (Redis.sunion ["rory"; "tim"] conn)) );
assert ( 1 = Redis.sunionstore "bob" ["rory"; "tim"] conn );
*)
(*
ignore ( Redis.srem "tim" "even cooler" conn );
assert ( "even cooler" = Redis.string_of_bulk_data (List.hd (Redis.sdiff "rory" ["tim"] conn)) );
assert ( 1 = Redis.sdiffstore "bob" "rory" ["tim"] conn);
Expand All @@ -132,10 +126,14 @@ let smoke_test_with_quit conn = begin
ignore (Redis.lpush "rory" "2" conn);
ignore (Redis.lpush "rory" "11" conn);

(* *)
(* Sorted sets *)
assert (Redis.zadd "coolest" 42.0 "rory" conn);
(*
assert (Redis.zrem "coolest" "rory" conn);
*)

(*
ignore (Redis.zadd "coolest" 1.0 "rory" conn);
ignore (Redis.zadd "coolest" 99.0 "tim" conn);
assert (
Expand Down
10 changes: 4 additions & 6 deletions tests/test_redis_sets.ml
Expand Up @@ -92,12 +92,10 @@ let test_sismember () =
use_test_script
((read_lines_from_list
["SADD"; "rory"; "cool"])
@ [
WriteThisLine(":1");
ReadThisLine("SISMEMBER rory 4");
ReadThisLine("cool");
WriteThisLine(":1");
])
@ [WriteThisLine(":1")]
@ (read_lines_from_list
["SISMEMBER"; "rory"; "cool"])
@ [WriteThisLine(":1")])
test_func;;

let test_smembers () =
Expand Down

0 comments on commit b687b3c

Please sign in to comment.