]> git.saurik.com Git - redis.git/commitdiff
Issue #330 regression test.
authorantirez <antirez@gmail.com>
Thu, 16 Feb 2012 15:13:40 +0000 (16:13 +0100)
committerantirez <antirez@gmail.com>
Thu, 16 Feb 2012 15:13:40 +0000 (16:13 +0100)
tests/unit/type/hash.tcl

index 04a5f4c75891ebc53ef8d1191e17ed39b0890f76..e9f7c1889b3c42a1bb9af20def44b373913d9909 100644 (file)
@@ -318,6 +318,14 @@ start_server {tags {"hash"}} {
         lappend rv [string match "ERR*not an integer*" $bigerr]
     } {1 1}
 
+    test {HINCRBY can detect overflows} {
+        set e {}
+        r hset hash n -9223372036854775484
+        assert {[r hincrby hash n -1] == -9223372036854775485}
+        catch {r hincrby hash n -10000} e
+        set e
+    } {*overflow*}
+
     test {HINCRBYFLOAT against non existing database key} {
         r del htest
         list [r hincrbyfloat htest foo 2.5]