mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 04:06:14 +00:00
Add test
This commit is contained in:
parent
79f654ced5
commit
610635e1c8
@ -1806,6 +1806,14 @@ TEST_CASE("[Variant] Writer and parser dictionary") {
|
|||||||
CHECK_MESSAGE(d_parsed == Variant(d), "Should parse back.");
|
CHECK_MESSAGE(d_parsed == Variant(d), "Should parse back.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("[Variant] Writer key sorting") {
|
||||||
|
Dictionary d = build_dictionary(StringName("C"), 3, "A", 1, StringName("B"), 2, "D", 4);
|
||||||
|
String d_str;
|
||||||
|
VariantWriter::write_to_string(d, d_str);
|
||||||
|
|
||||||
|
CHECK_EQ(d_str, "{\n\"A\": 1,\n&\"B\": 2,\n&\"C\": 3,\n\"D\": 4\n}");
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("[Variant] Writer recursive dictionary") {
|
TEST_CASE("[Variant] Writer recursive dictionary") {
|
||||||
// There is no way to accurately represent a recursive dictionary,
|
// There is no way to accurately represent a recursive dictionary,
|
||||||
// the only thing we can do is make sure the writer doesn't blow up
|
// the only thing we can do is make sure the writer doesn't blow up
|
||||||
|
Loading…
Reference in New Issue
Block a user