mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
map: fix in for deleted keys
This commit is contained in:
@@ -168,6 +168,17 @@ fn test_mut_arg() {
|
||||
assert m['a'] == 10
|
||||
}
|
||||
|
||||
fn test_delete() {
|
||||
mut m := map[string]int
|
||||
m['one'] = 1
|
||||
m['two'] = 2
|
||||
println(m['two']) // => "2"
|
||||
m.delete('two')
|
||||
println(m['two']) // => 0
|
||||
assert 'two' in m == false
|
||||
println('two' in m) // => true, on Linux and Windows <-- wrong !
|
||||
}
|
||||
|
||||
/*
|
||||
fn test_ref() {
|
||||
m := { 'one': 1 }
|
||||
|
||||
Reference in New Issue
Block a user