v2 / vlib / v / tests / concurrency / sync_channel_push_string_literal_test.v
9 lines · 8 sloc · 176 bytes · 8b1aec5bc75e92fd906ae41638d5ed301074b5d0
Raw
1import sync
2
3fn test_sync_channel_push_string_literal() {
4 mut ch := sync.new_channel[string](1)
5 ch.push('Hello')
6 mut got := ''
7 assert ch.pop(&got)
8 assert got == 'Hello'
9}
10