Commit 209f266c authored by antirez's avatar antirez
Browse files

Merge branch '1906-merge' into unstable

parents c951c3ee 1f8a6d80
...@@ -353,7 +353,7 @@ proc colorstr {color str} { ...@@ -353,7 +353,7 @@ proc colorstr {color str} {
default {set colorcode {37}} default {set colorcode {37}}
} }
if {$colorcode ne {}} { if {$colorcode ne {}} {
return "\033\[$b;${colorcode};40m$str\033\[0m" return "\033\[$b;${colorcode};49m$str\033\[0m"
} }
} else { } else {
return $str return $str
......
...@@ -404,6 +404,12 @@ start_server {tags {"basic"}} { ...@@ -404,6 +404,12 @@ start_server {tags {"basic"}} {
r move mykey 10 r move mykey 10
} {0} } {0}
test {MOVE against non-integer DB (#1428)} {
r set mykey hello
catch {r move mykey notanumber} e
set e
} {*ERR*index out of range}
test {SET/GET keys in different DBs} { test {SET/GET keys in different DBs} {
r set a hello r set a hello
r set b world r set b world
...@@ -769,4 +775,9 @@ start_server {tags {"basic"}} { ...@@ -769,4 +775,9 @@ start_server {tags {"basic"}} {
r keys * r keys *
r keys * r keys *
} {dlskeriewrioeuwqoirueioqwrueoqwrueqw} } {dlskeriewrioeuwqoirueioqwrueoqwrueqw}
test {GETRANGE with huge ranges, Github issue #1844} {
r set foo bar
r getrange foo 0 4294967297
} {bar}
} }
...@@ -196,6 +196,10 @@ start_server {tags {"pubsub"}} { ...@@ -196,6 +196,10 @@ start_server {tags {"pubsub"}} {
$rd1 close $rd1 close
} }
test "NUMSUB returns numbers, not strings (#1561)" {
r pubsub numsub abc def
} {abc 0 def 0}
test "Mix SUBSCRIBE and PSUBSCRIBE" { test "Mix SUBSCRIBE and PSUBSCRIBE" {
set rd1 [redis_deferring_client] set rd1 [redis_deferring_client]
assert_equal {1} [subscribe $rd1 {foo.bar}] assert_equal {1} [subscribe $rd1 {foo.bar}]
......
...@@ -358,6 +358,11 @@ start_server {tags {"scripting"}} { ...@@ -358,6 +358,11 @@ start_server {tags {"scripting"}} {
return redis.call("get", "key") return redis.call("get", "key")
} 0 } 0
} {12039611435714932082} } {12039611435714932082}
test {Verify negative arg count is error instead of crash (issue #1842)} {
catch { r eval { return "hello" } -12 } e
set e
} {ERR Number of keys can't be negative}
} }
# Start a new server since the last test in this stanza will kill the # Start a new server since the last test in this stanza will kill the
......
...@@ -95,6 +95,14 @@ start_server { ...@@ -95,6 +95,14 @@ start_server {
assert_encoding ziplist sort-res assert_encoding ziplist sort-res
} }
test "SORT extracts STORE correctly" {
r command getkeys sort abc store def
} {abc def}
test "SORT extracts multiple STORE correctly" {
r command getkeys sort abc store invalid store stillbad store def
} {abc def}
test "SORT DESC" { test "SORT DESC" {
assert_equal [lsort -decreasing -integer $result] [r sort tosort DESC] assert_equal [lsort -decreasing -integer $result] [r sort tosort DESC]
} }
......
...@@ -50,7 +50,7 @@ def commands ...@@ -50,7 +50,7 @@ def commands
require "json" require "json"
require "uri" require "uri"
url = URI.parse "https://raw.github.com/antirez/redis-doc/master/commands.json" url = URI.parse "https://raw.githubusercontent.com/antirez/redis-doc/master/commands.json"
client = Net::HTTP.new url.host, url.port client = Net::HTTP.new url.host, url.port
client.use_ssl = true client.use_ssl = true
response = client.get url.path response = client.get url.path
......
...@@ -152,7 +152,7 @@ rm -f $TMP_FILE ...@@ -152,7 +152,7 @@ rm -f $TMP_FILE
#we hard code the configs here to avoid issues with templates containing env vars #we hard code the configs here to avoid issues with templates containing env vars
#kinda lame but works! #kinda lame but works!
REDIS_INIT_HEADER=\ REDIS_INIT_HEADER=\
"#/bin/sh\n "#!/bin/sh\n
#Configurations injected by install_server below....\n\n #Configurations injected by install_server below....\n\n
EXEC=$REDIS_EXECUTABLE\n EXEC=$REDIS_EXECUTABLE\n
CLIEXEC=$CLI_EXEC\n CLIEXEC=$CLI_EXEC\n
...@@ -193,7 +193,7 @@ fi ...@@ -193,7 +193,7 @@ fi
# warning if init info is not available. # warning if init info is not available.
cat > ${TMP_FILE} <<EOT cat > ${TMP_FILE} <<EOT
#/bin/sh #!/bin/sh
#Configurations injected by install_server below.... #Configurations injected by install_server below....
EXEC=$REDIS_EXECUTABLE EXEC=$REDIS_EXECUTABLE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment