mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
sds.c: more tests for sdstrim().
This commit is contained in:
parent
d2aa91ce1f
commit
9bb4ef871e
12
src/sds.c
12
src/sds.c
@ -1013,6 +1013,18 @@ int main(void) {
|
||||
sdslen(x) == 35 &&
|
||||
memcmp(x,"--4294967295,18446744073709551615--",35) == 0)
|
||||
|
||||
sdsfree(x);
|
||||
x = sdsnew(" x ");
|
||||
sdstrim(x," x");
|
||||
test_cond("sdstrim() works when all chars match",
|
||||
sdslen(x) == 0)
|
||||
|
||||
sdsfree(x);
|
||||
x = sdsnew(" x ");
|
||||
sdstrim(x," ");
|
||||
test_cond("sdstrim() works when a single char remains",
|
||||
sdslen(x) == 1 && x[0] == 'x')
|
||||
|
||||
sdsfree(x);
|
||||
x = sdsnew("xxciaoyyy");
|
||||
sdstrim(x,"xy");
|
||||
|
Loading…
x
Reference in New Issue
Block a user