Skip to content

Commit

Permalink
Moved LTRIM to URP
Browse files Browse the repository at this point in the history
  • Loading branch information
rgeoghegan committed May 2, 2011
1 parent 4018d40 commit 51e1eea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/redis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,10 @@ let lrange key start stop connection =

let ltrim key start stop connection =
(* LTRIM, please note that the word 'end' is a keyword in ocaml, so it has been replaced by 'stop' *)
match send_and_receive_command_safely (Printf.sprintf "LTRIM %s %d %d" key start stop) connection with
Status("OK") -> () |
_ -> failwith "Did not recognize what I got back";;
match send_multibulk_and_receive_command_safely
["LTRIM"; key; string_of_int start; string_of_int stop] connection with
Status("OK") -> () |
_ -> failwith "Did not recognize what I got back";;

let lindex key index connection =
(* LINDEX *)
Expand Down
9 changes: 4 additions & 5 deletions tests/test_redis_lists.ml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ let test_ltrim () =
@ [WriteThisLine(":1")]
@ (read_lines_from_list
["RPUSH"; "rory"; "still cool"])
@ [
WriteThisLine(":2");
ReadThisLine("LTRIM rory 0 1");
WriteThisLine("+OK")
])
@ [WriteThisLine(":2")]
@ (read_lines_from_list
["LTRIM"; "rory"; "0"; "1"])
@ [WriteThisLine("+OK")])
test_func;;

let test_lset () =
Expand Down

0 comments on commit 51e1eea

Please sign in to comment.