rust/src/test/run-pass/pipe-select-macro.rs

53 lines
769 B
Rust
Raw Normal View History

// xfail-pretty
// Protocols
proto! foo (
foo:recv {
do_foo -> foo
}
)
proto! bar (
bar:recv {
do_bar(int) -> barbar,
do_baz(bool) -> bazbar,
}
barbar:send {
rebarbar -> bar,
}
bazbar:send {
rebazbar -> bar
}
)
fn macros() {
include!("select-macro.rs");
}
// Code
fn test(+foo: foo::client::foo, +bar: bar::client::bar) {
2012-08-13 18:03:13 -05:00
import bar::do_baz;
2012-08-22 19:24:52 -05:00
select! (
foo => {
foo::do_foo -> _next {
}
}
bar => {
bar::do_bar(x) -> _next {
2012-08-13 18:03:13 -05:00
debug!("%?", x)
},
do_baz(b) -> _next {
if *b { debug!("true") } else { debug!("false") }
}
}
2012-08-22 19:24:52 -05:00
)
}
fn main() {
}