duckscript/test/std/collections/map_is_empty_test.ds
2020-02-01 13:21:31 +00:00

36 lines
622 B
Plaintext

fn test_size_empty
handle = map
result = map_is_empty ${handle}
assert ${result}
release ${handle}
end
fn test_size_emptied
handle = map
result = map_put ${handle} key value
assert_eq ${result} true
map_remove ${handle} key
result = map_is_empty ${handle}
assert ${result}
release ${handle}
end
fn test_size_not_empty
handle = map
result = map_put ${handle} a 1
result = map_put ${handle} b 2
result = map_put ${handle} c 3
result = map_put ${handle} a 4
result = map_is_empty ${handle}
assert_false ${result}
release ${handle}
end