Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
370929ac
Commit
370929ac
authored
May 03, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overworked test case
parent
c458bf18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
test/unit.cpp
test/unit.cpp
+13
-13
No files found.
test/unit.cpp
View file @
370929ac
...
...
@@ -7695,7 +7695,7 @@ TEST_CASE("parser class")
)"
;
auto
s_array
=
R"(
[1,2,
3,4,[5]
]
[1,2,
[3],4,5
]
)"
;
SECTION
(
"filter nothing"
)
...
...
@@ -7712,7 +7712,7 @@ TEST_CASE("parser class")
return
true
;
});
CHECK
(
j_array
==
json
({
1
,
2
,
3
,
4
,
{
5
}
}));
CHECK
(
j_array
==
json
({
1
,
2
,
{
3
},
4
,
5
}));
}
SECTION
(
"filter everything"
)
...
...
@@ -7761,7 +7761,7 @@ TEST_CASE("parser class")
}
});
CHECK
(
j_array
==
json
({
1
,
3
,
4
,
{
5
}
}));
CHECK
(
j_array
==
json
({
1
,
{
3
},
4
,
5
}));
}
SECTION
(
"filter specific events"
)
...
...
@@ -7801,19 +7801,18 @@ TEST_CASE("parser class")
SECTION
(
"second closing event"
)
{
int
i
=
0
;
json
j_object
=
json
::
parse
(
s_object
,
[
&
i
](
int
,
json
::
parse_event_t
e
,
const
json
&
)
bool
second
=
false
;
json
j_object
=
json
::
parse
(
s_object
,
[
&
second
](
int
,
json
::
parse_event_t
e
,
const
json
&
)
{
// filter all number(2) elements
if
(
e
==
json
::
parse_event_t
::
object_end
)
{
if
(
i
>
0
)
if
(
second
)
{
return
false
;
}
else
{
++
i
;
second
=
true
;
return
true
;
}
}
...
...
@@ -7824,20 +7823,20 @@ TEST_CASE("parser class")
});
CHECK
(
j_object
.
is_discarded
());
CHECK
(
second
);
i
=
0
;
json
j_array
=
json
::
parse
(
s_array
,
[
&
i
](
int
,
json
::
parse_event_t
e
,
const
json
&
)
second
=
false
;
json
j_array
=
json
::
parse
(
s_array
,
[
&
second
](
int
,
json
::
parse_event_t
e
,
const
json
&
)
{
// filter all number(2) elements
if
(
e
==
json
::
parse_event_t
::
array_end
)
{
if
(
i
>
0
)
if
(
second
)
{
return
false
;
}
else
{
++
i
;
second
=
true
;
return
true
;
}
}
...
...
@@ -7848,6 +7847,7 @@ TEST_CASE("parser class")
});
CHECK
(
j_array
.
is_discarded
());
CHECK
(
second
);
}
}
}
...
...
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