Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
concurrency
/
shared_map_delete_test.v
14
lines
·
13
sloc
·
238 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
fn
test_shared_map_delete() {
2
shared store := map[string]int{}
3
lock store {
4
store[
'abc'
] = 5
5
store[
'xyz'
] = 10
6
}
7
8
lock store {
9
assert store.len == 2
10
store.delete(
'abc'
)
11
assert store.len == 1
12
assert store[
'xyz'
] == 10
13
}
14
}
15