mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-08 22:20:56 +00:00
Extended symbolic enum parsing in JSON for integers and OR-ing.
Change-Id: Iedbd9914a1ca3897776fb92aa9a1fdfc4603da3c Tested: on Windows and Linux
This commit is contained in:
@@ -504,10 +504,14 @@ void ScientificTest() {
|
||||
}
|
||||
|
||||
void EnumStringsTest() {
|
||||
flatbuffers::Parser parser;
|
||||
|
||||
TEST_EQ(parser.Parse("enum E:byte { A, B, C } table T { F:[E]; } root_type T;"
|
||||
"{ F:[ A, B, \"C\" ] }"), true);
|
||||
flatbuffers::Parser parser1;
|
||||
TEST_EQ(parser1.Parse("enum E:byte { A, B, C } table T { F:[E]; }"
|
||||
"root_type T;"
|
||||
"{ F:[ A, B, \"C\", \"A B C\" ] }"), true);
|
||||
flatbuffers::Parser parser2;
|
||||
TEST_EQ(parser2.Parse("enum E:byte { A, B, C } table T { F:[int]; }"
|
||||
"root_type T;"
|
||||
"{ F:[ \"E.C\", \"E.A E.B E.C\" ] }"), true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user