mirror of
https://github.com/php-win-ext/phpredis.git
synced 2026-03-24 00:52:16 +01:00
Add a regression test
This commit is contained in:
committed by
Michael Grunder
parent
35df8ad7c2
commit
22a2914b09
@@ -2658,9 +2658,10 @@ class Redis_Test extends TestSuite {
|
||||
}
|
||||
|
||||
public function testZAddFirstArg() {
|
||||
$this->redis->del('key');
|
||||
|
||||
$zsetName = 100; // not a string!
|
||||
|
||||
$this->redis->del($zsetName);
|
||||
|
||||
$this->assertEquals(1, $this->redis->zAdd($zsetName, 0, 'val0'));
|
||||
$this->assertEquals(1, $this->redis->zAdd($zsetName, 1, 'val1'));
|
||||
|
||||
@@ -2676,6 +2677,17 @@ class Redis_Test extends TestSuite {
|
||||
$this->assertFalse($this->redis->zAdd('zset', ['incr'], 10, 'value', 20, 'value2'));
|
||||
}
|
||||
|
||||
/* Regression test for GitHub issue #2697 */
|
||||
public function testZAddLargeLong() {
|
||||
$this->redis->del('key');
|
||||
|
||||
$val = 5000000000;
|
||||
|
||||
$this->assertEquals(1, $this->redis->zAdd('key', $val, 'val0'));
|
||||
|
||||
$this->assertEquals($this->redis->zscore('key', 'val0'), (float)$val);
|
||||
}
|
||||
|
||||
public function testZX() {
|
||||
$this->redis->del('key');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user