Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9bb4ef87
Commit
9bb4ef87
authored
Dec 10, 2014
by
antirez
Browse files
sds.c: more tests for sdstrim().
parent
d2aa91ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sds.c
View file @
9bb4ef87
...
@@ -1013,6 +1013,18 @@ int main(void) {
...
@@ -1013,6 +1013,18 @@ int main(void) {
sdslen
(
x
)
==
35
&&
sdslen
(
x
)
==
35
&&
memcmp
(
x
,
"--4294967295,18446744073709551615--"
,
35
)
==
0
)
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
);
sdsfree
(
x
);
x
=
sdsnew
(
"xxciaoyyy"
);
x
=
sdsnew
(
"xxciaoyyy"
);
sdstrim
(
x
,
"xy"
);
sdstrim
(
x
,
"xy"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment