Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
1ef31461
Commit
1ef31461
authored
Dec 07, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test_skip_quoted()
parent
0263e395
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
unit_test.c
test/unit_test.c
+19
-0
No files found.
test/unit_test.c
View file @
1ef31461
...
@@ -362,6 +362,24 @@ static void test_mg_stat(void) {
...
@@ -362,6 +362,24 @@ static void test_mg_stat(void) {
ASSERT
(
!
mg_stat
(
fc
(
&
ctx
),
" does not exist "
,
&
file
));
ASSERT
(
!
mg_stat
(
fc
(
&
ctx
),
" does not exist "
,
&
file
));
}
}
static
void
test_skip_quoted
(
void
)
{
char
x
[]
=
"a=1, b=2 c='hi
\'
there'"
,
*
s
=
x
,
*
p
;
p
=
skip_quoted
(
&
s
,
", "
,
", "
,
0
);
ASSERT
(
p
!=
NULL
&&
!
strcmp
(
p
,
"a=1"
));
p
=
skip_quoted
(
&
s
,
", "
,
", "
,
0
);
ASSERT
(
p
!=
NULL
&&
!
strcmp
(
p
,
"b=2"
));
// TODO(lsm): fix this
#if 0
p = skip_quoted(&s, "'", ", ", '\\');
p = skip_quoted(&s, "'", ", ", '\\');
printf("[%s]\n", p);
ASSERT(p != NULL && !strcmp(p, "hi ' there"));
#endif
}
int
main
(
void
)
{
int
main
(
void
)
{
test_base64_encode
();
test_base64_encode
();
test_match_prefix
();
test_match_prefix
();
...
@@ -377,5 +395,6 @@ int main(void) {
...
@@ -377,5 +395,6 @@ int main(void) {
#ifdef USE_LUA
#ifdef USE_LUA
test_lua
();
test_lua
();
#endif
#endif
test_skip_quoted
();
return
0
;
return
0
;
}
}
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