Skip to content

Commit 51e1ce2

Browse files
author
Eric Holk
committed
Added a couple of test cases for sending messages. One works as expected, the other succeeds unexpectedly.
1 parent 4eb476f commit 51e1ce2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/test/run-fail/trivial-message2.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
This program should hang on the r <- po line.
3+
*/
4+
5+
fn main() {
6+
let port[int] po = port();
7+
let chan[int] ch = chan(po);
8+
9+
auto r <- po;
10+
11+
ch <| 42;
12+
13+
log_err r;
14+
}

src/test/run-pass/trivial-message.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
This is about the simplest program that can successfully send a
3+
message.
4+
*/
5+
6+
fn main() {
7+
let port[int] po = port();
8+
let chan[int] ch = chan(po);
9+
10+
ch <| 42;
11+
12+
auto r <- po;
13+
14+
log_err r;
15+
}

0 commit comments

Comments
 (0)