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
6678eb2b
Unverified
Commit
6678eb2b
authored
7 years ago
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved test coverage #1031
parent
16c5bfea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
test/src/unit-wstring.cpp
test/src/unit-wstring.cpp
+27
-0
No files found.
test/src/unit-wstring.cpp
View file @
6678eb2b
...
...
@@ -62,6 +62,15 @@ TEST_CASE("wide strings")
}
}
SECTION
(
"invalid std::wstring"
)
{
if
(
wstring_is_utf16
())
{
std
::
wstring
w
=
L"
\"\xDBFF
"
;
CHECK_THROWS_AS
(
json
::
parse
(
w
),
json
::
parse_error
&
);
}
}
SECTION
(
"std::u16string"
)
{
if
(
u16string_is_utf16
())
...
...
@@ -72,6 +81,15 @@ TEST_CASE("wide strings")
}
}
SECTION
(
"invalid std::u16string"
)
{
if
(
wstring_is_utf16
())
{
std
::
u16string
w
=
u"
\"\xDBFF
"
;
CHECK_THROWS_AS
(
json
::
parse
(
w
),
json
::
parse_error
&
);
}
}
SECTION
(
"std::u32string"
)
{
if
(
u32string_is_utf32
())
...
...
@@ -81,4 +99,13 @@ TEST_CASE("wide strings")
CHECK
(
j
.
dump
()
==
"[12.2,
\"
Ⴥaäö💤🧢
\"
]"
);
}
}
SECTION
(
"invalid std::u32string"
)
{
if
(
u32string_is_utf32
())
{
std
::
u32string
w
=
U"
\"\x1100
00"
;
CHECK_THROWS_AS
(
json
::
parse
(
w
),
json
::
parse_error
&
);
}
}
}
This diff is collapsed.
Click to expand it.
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