Added two test cases

This commit is contained in:
Mario Liebisch 2023-03-11 18:53:17 +01:00
parent 4e72e09343
commit 62e1a5e235
No known key found for this signature in database
GPG Key ID: 32B56AC1F87EFBF9

View File

@ -88,6 +88,12 @@ TEST_CASE("[Dictionary] Assignment using bracket notation ([])") {
CHECK(int(map[0]) == 400);
// Check that assigning 0 doesn't overwrite the value for `false`.
CHECK(int(map[false]) == 128);
// Ensure read-only maps aren't modified by non-existing keys.
const auto length = map.size();
map.make_read_only();
CHECK(int(map["This key does not exist"].get_type()) == Variant::NIL);
CHECK(map.size() == length);
}
TEST_CASE("[Dictionary] get_key_lists()") {