Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
463c38df
Commit
463c38df
authored
Feb 11, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test case
parent
4b9bd96a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
json.hpp
src/json.hpp
+2
-2
json.hpp.re2c
src/json.hpp.re2c
+2
-2
unit.cpp
test/unit.cpp
+7
-2
No files found.
src/json.hpp
View file @
463c38df
...
@@ -2443,10 +2443,10 @@ class basic_json
...
@@ -2443,10 +2443,10 @@ class basic_json
return
":"
;
return
":"
;
case
(
token_type
:
:
value_separator
)
:
case
(
token_type
:
:
value_separator
)
:
return
","
;
return
","
;
case
(
token_type
:
:
parse_error
)
:
return
"<parse error>"
;
case
(
token_type
:
:
end_of_input
)
:
case
(
token_type
:
:
end_of_input
)
:
return
"<end of input>"
;
return
"<end of input>"
;
default
:
return
"<parse error>"
;
}
}
}
}
...
...
src/json.hpp.re2c
View file @
463c38df
...
@@ -2443,10 +2443,10 @@ class basic_json
...
@@ -2443,10 +2443,10 @@ class basic_json
return ":";
return ":";
case (token_type::value_separator):
case (token_type::value_separator):
return ",";
return ",";
case (token_type::parse_error):
return "<parse error>";
case (token_type::end_of_input):
case (token_type::end_of_input):
return "<end of input>";
return "<end of input>";
default:
return "<parse error>";
}
}
}
}
...
...
test/unit.cpp
View file @
463c38df
...
@@ -4037,7 +4037,7 @@ TEST_CASE("lexer class")
...
@@ -4037,7 +4037,7 @@ TEST_CASE("lexer class")
CHECK
(
json
::
lexer
::
token_type_name
(
json
::
lexer
::
token_type
::
parse_error
)
==
"<parse error>"
);
CHECK
(
json
::
lexer
::
token_type_name
(
json
::
lexer
::
token_type
::
parse_error
)
==
"<parse error>"
);
CHECK
(
json
::
lexer
::
token_type_name
(
json
::
lexer
::
token_type
::
end_of_input
)
==
"<end of input>"
);
CHECK
(
json
::
lexer
::
token_type_name
(
json
::
lexer
::
token_type
::
end_of_input
)
==
"<end of input>"
);
}
}
SECTION
(
"parse errors on first character"
)
SECTION
(
"parse errors on first character"
)
{
{
for
(
int
c
=
1
;
c
<
128
;
++
c
)
for
(
int
c
=
1
;
c
<
128
;
++
c
)
...
@@ -4066,12 +4066,17 @@ TEST_CASE("lexer class")
...
@@ -4066,12 +4066,17 @@ TEST_CASE("lexer class")
case
(
'7'
):
case
(
'7'
):
case
(
'8'
):
case
(
'8'
):
case
(
'9'
):
case
(
'9'
):
case
(
'"'
):
{
{
CHECK
(
json
::
lexer
(
s
.
c_str
()).
scan
()
!=
json
::
lexer
::
token_type
::
parse_error
);
CHECK
(
json
::
lexer
(
s
.
c_str
()).
scan
()
!=
json
::
lexer
::
token_type
::
parse_error
);
break
;
break
;
}
}
case
(
'"'
):
{
// no idea what to do here
break
;
}
// whitespace
// whitespace
case
(
' '
):
case
(
' '
):
case
(
'\t'
):
case
(
'\t'
):
...
...
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