Skip to content

Commit

Permalink
Fixed JSON serialization 'enum_to_string' issues.
Browse files Browse the repository at this point in the history
Added unit tests for CLI, Encoding, JSON Serialization Exceptions
  • Loading branch information
refvalue committed Nov 18, 2024
1 parent 228b491 commit ba83095
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/cli_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ MAKE_TEST(option) {
parser.on_error([](std::string_view message) {});
parser.on_output([](std::string_view message) {});

if (parser.parse(std::vector<abi::string>{U8("-b"), U8("-i=2"), U8("--float32=3.14"), U8("--string"), U8("hello"),
U8("-a=dog"), U8("--lines"), U8("123,abc"), U8("--numbers=2,2,2,3,1,1"), U8("-z"), U8("cat,mouse,dog"),
U8("other"), U8("lol")});
if (parser.parse(std::vector<essence::abi::string>{U8("-b"), U8("-i=2"), U8("--float32=3.14"), U8("--string"),
U8("hello"), U8("-a=dog"), U8("--lines"), U8("123,abc"), U8("--numbers=2,2,2,3,1,1"), U8("-z"),
U8("cat,mouse,dog"), U8("other"), U8("lol")});
parser) {
struct foo {
bool boolean{};
Expand Down
5 changes: 3 additions & 2 deletions test/encoding_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ MAKE_TEST(conversion) {
constexpr std::u16string_view u16_str{u"Hello world!"};
constexpr std::u16string_view u16_cjk_str{u"中日韩汉字"};

const abi::vector<std::uint16_t> u16_vec{u'H', u'e', u'l', u'l', u'o', u' ', u'w', u'o', u'r', u'l', u'd', u'!'};
const abi::vector<std::uint16_t> u16_cjk_vec{u'', u'', u'', u'', u''};
const essence::abi::vector<std::uint16_t> u16_vec{
u'H', u'e', u'l', u'l', u'o', u' ', u'w', u'o', u'r', u'l', u'd', u'!'};
const essence::abi::vector<std::uint16_t> u16_cjk_vec{u'', u'', u'', u'', u''};

#ifdef _WIN32
ASSERT_EQ(to_native_string(str), wide_str);
Expand Down

0 comments on commit ba83095

Please sign in to comment.