Skip to content

Commit 382a786

Browse files
committed
Added tests for the extended key validation
1 parent 7266824 commit 382a786

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tests/keys.phpt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ $ascii = memc_get_instance ();
1515
var_dump ($binary->set ('binary key with spaces', 'this is a test'));
1616
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
1717

18+
var_dump ($binary->set ('binarykeywith\nnewline', 'this is a test'));
19+
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
20+
1821
var_dump ($ascii->set ('ascii key with spaces', 'this is a test'));
1922
var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
2023

24+
var_dump ($binary->set ('asciikeywith\nnewline', 'this is a test'));
25+
var_dump ($binary->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
26+
27+
var_dump ($ascii->set (''/*empty key*/, 'this is a test'));
28+
var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
29+
2130
var_dump ($ascii->set (str_repeat ('1234567890', 512), 'this is a test'));
2231
var_dump ($ascii->getResultCode () == Memcached::RES_BAD_KEY_PROVIDED);
2332

@@ -30,4 +39,10 @@ bool(false)
3039
bool(true)
3140
bool(false)
3241
bool(true)
42+
bool(false)
43+
bool(true)
44+
bool(false)
45+
bool(true)
46+
bool(false)
47+
bool(true)
3348
OK

0 commit comments

Comments
 (0)