Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
concurrency
/
chan_fixed_test.v
8
lines
·
8
sloc
·
151 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
fn
test_main() {
2
a := chan [2]int{cap: 10}
3
c := [1, 2]!
4
dump(a.try_push(&c))
5
mut
d := [0, 0]!
6
dump(a.try_pop(
mut
d))
7
assert dump(d) == [1, 2]!
8
}
9