v/vlib/v/tests/map_mut_fn_test.v

21 lines
277 B
V

fn print_all(mut m map[string]string) {
for k, v in m {
println(k)
println(v)
m[k] = 'foo'
}
assert m['test'] == 'foo'
}
fn test_map_mutable_arg() {
mut m := map[string]string{}
m['test'] = 'test'
for k, v in m {
println(k)
println(v)
}
print_all(mut m)
}