Added a couple of test cases for sending messages. One works as expected, the other succeeds unexpectedly.
This commit is contained in:
parent
4eb476fc75
commit
51e1ce292d
2 changed files with 29 additions and 0 deletions
14
src/test/run-fail/trivial-message2.rs
Normal file
14
src/test/run-fail/trivial-message2.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
This program should hang on the r <- po line.
|
||||
*/
|
||||
|
||||
fn main() {
|
||||
let port[int] po = port();
|
||||
let chan[int] ch = chan(po);
|
||||
|
||||
auto r <- po;
|
||||
|
||||
ch <| 42;
|
||||
|
||||
log_err r;
|
||||
}
|
||||
15
src/test/run-pass/trivial-message.rs
Normal file
15
src/test/run-pass/trivial-message.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
This is about the simplest program that can successfully send a
|
||||
message.
|
||||
*/
|
||||
|
||||
fn main() {
|
||||
let port[int] po = port();
|
||||
let chan[int] ch = chan(po);
|
||||
|
||||
ch <| 42;
|
||||
|
||||
auto r <- po;
|
||||
|
||||
log_err r;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue