We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 002889a commit a7dc01eCopy full SHA for a7dc01e
test/gleam/erlang/process_test.gleam
@@ -51,6 +51,27 @@ pub fn receive_test() {
51
let assert Error(Nil) = process.receive(subject, 0)
52
}
53
54
+pub fn receive_forever_test() {
55
+ let subject = process.new_subject()
56
+
57
+ // Send message from self
58
+ process.send(subject, 0)
59
60
+ // Send message from another process
61
+ process.start(
62
+ fn() {
63
+ process.send(subject, 1)
64
+ process.send(subject, 2)
65
+ },
66
+ linked: True,
67
+ )
68
69
+ // Assert all the messages arrived
70
+ let assert 0 = process.receive_forever(subject)
71
+ let assert 1 = process.receive_forever(subject)
72
+ let assert 2 = process.receive_forever(subject)
73
+}
74
75
pub fn is_alive_test() {
76
let pid = process.start(fn() { Nil }, False)
77
process.sleep(5)
0 commit comments