Skip to content

Commit

Permalink
new test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Sep 10, 2023
1 parent b0fb9fb commit 982528c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions vlib/v/tests/shared_map_ptr_test.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
struct Abc {
f shared map[string]&Abc
}

fn test_main() {
c := Abc{}
b := Abc{}
a := Abc{
f: b.f
}

lock a.f, b.f {
a.f['a'] = &c
}
lock b.f {
b.f['b'] = &c
}

dump(b.f)
rlock b.f {
assert b.f.len == 2
}
}

0 comments on commit 982528c

Please sign in to comment.