summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/instances.tcl2
-rw-r--r--tests/unit/latency-monitor.tcl14
-rw-r--r--tests/unit/type/incr.tcl7
-rw-r--r--tests/unit/type/zset.tcl4
4 files changed, 26 insertions, 1 deletions
diff --git a/tests/instances.tcl b/tests/instances.tcl
index 2ba67ac19..357b34818 100644
--- a/tests/instances.tcl
+++ b/tests/instances.tcl
@@ -318,7 +318,7 @@ proc end_tests {} {
puts "GOOD! No errors."
exit 0
} else {
- puts "WARNING $::failed tests faield."
+ puts "WARNING $::failed test(s) failed."
exit 1
}
}
diff --git a/tests/unit/latency-monitor.tcl b/tests/unit/latency-monitor.tcl
index b736cad98..69da13f06 100644
--- a/tests/unit/latency-monitor.tcl
+++ b/tests/unit/latency-monitor.tcl
@@ -47,4 +47,18 @@ start_server {tags {"latency-monitor"}} {
assert {[r latency reset] > 0}
assert {[r latency latest] eq {}}
}
+
+ test {LATENCY of expire events are correctly collected} {
+ r config set latency-monitor-threshold 20
+ r eval {
+ local i = 0
+ while (i < 1000000) do
+ redis.call('sadd','mybigkey',i)
+ i = i+1
+ end
+ } 0
+ r pexpire mybigkey 1
+ after 500
+ assert_match {*expire-cycle*} [r latency latest]
+ }
}
diff --git a/tests/unit/type/incr.tcl b/tests/unit/type/incr.tcl
index 2287aaae2..a58710d39 100644
--- a/tests/unit/type/incr.tcl
+++ b/tests/unit/type/incr.tcl
@@ -144,4 +144,11 @@ start_server {tags {"incr"}} {
r set foo 1
roundFloat [r incrbyfloat foo -1.1]
} {-0.1}
+
+ test {string to double with null terminator} {
+ r set foo 1
+ r setrange foo 2 2
+ catch {r incrbyfloat foo 1} err
+ format $err
+ } {ERR*valid*}
}
diff --git a/tests/unit/type/zset.tcl b/tests/unit/type/zset.tcl
index 82f76befe..564825ae9 100644
--- a/tests/unit/type/zset.tcl
+++ b/tests/unit/type/zset.tcl
@@ -696,6 +696,10 @@ start_server {tags {"zset"}} {
}
}
+ test "ZSET commands don't accept the empty strings as valid score" {
+ assert_error "*not*float*" {r zadd myzset "" abc}
+ }
+
proc stressers {encoding} {
if {$encoding == "ziplist"} {
# Little extra to allow proper fuzzing in the sorting stresser