Permalink
Browse files

Add new Redis 2.6 command: TIME.

  • Loading branch information...
1 parent 6e5f442 commit 90de034782ad0b3eea02008af6a15dea9b9d6d37 @nrk committed Mar 31, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 src/redis.lua
  2. +9 −0 test/test_client.lua
View
@@ -1052,6 +1052,7 @@ commands = {
lastsave = command('LASTSAVE'),
flushdb = command('FLUSHDB'),
flushall = command('FLUSHALL'),
+ time = command('TIME'), -- >= 2.6
shutdown = command('SHUTDOWN', {
request = fire_and_forget
}),
View
@@ -2192,6 +2192,15 @@ context("Redis commands", function()
redis:config('set', 'slowlog-log-slower-than', previous or 10000)
end)
+ test("TIME (redis:time)", function()
+ if version:is('<', '2.5.0') then return end
+
+ local redis_time = redis:time()
+ assert_type(redis_time, 'table')
+ assert_not_nil(redis_time[1])
+ assert_not_nil(redis_time[2])
+ end)
+
test("CLIENT (redis:client)", function()
if version:is('<', '2.4.0') then return end
-- TODO: implement tests

0 comments on commit 90de034

Please sign in to comment.