mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
builtin: add a map.clear() method (#14373)
This commit is contained in:
parent
49382f1f43
commit
901b8f0c24
2 changed files with 16 additions and 0 deletions
|
@ -245,6 +245,14 @@ fn test_mut_arg() {
|
|||
assert a == 10
|
||||
}
|
||||
|
||||
fn test_clear() {
|
||||
mut m := map[string]int{}
|
||||
m['one'] = 1
|
||||
m['two'] = 2
|
||||
m.clear()
|
||||
assert m.len == 0
|
||||
}
|
||||
|
||||
fn test_delete() {
|
||||
mut m := map[string]int{}
|
||||
m['one'] = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue