Skip to content

Commit 98c6cbc

Browse files
committed
erlust_derive: make the example crash again
1 parent 1e100e2 commit 98c6cbc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

erlust_derive/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ erased-serde = "0.3"
2323
erlust = { path = "../erlust" }
2424
serde = "1.0"
2525
serde_derive = "1.0"
26+
tokio = { version = "0.1", features = ["async-await-preview"] }

erlust_derive/tests/tests.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
extern crate erlust_derive;
55
#[macro_use]
66
extern crate serde_derive;
7+
#[macro_use]
8+
extern crate tokio;
79

810
use erlust_derive::receive;
911

@@ -35,10 +37,10 @@ fn quux(x: usize) -> String {
3537
format!("{}", x)
3638
}
3739

38-
// TODO: (B) this example is actually stupid, its name refers to the macro
40+
// TODO: (B) make this example actually test both sending and receiving
3941
#[test]
40-
fn non_stupid() {
41-
async {
42+
fn passes_one_message() {
43+
tokio::run_async(async {
4244
assert_eq!(
4345
"test",
4446
receive!(
@@ -47,7 +49,7 @@ fn non_stupid() {
4749
Bar: (_pid, Bar(x)) if baz(*x) => quux(x),
4850
)
4951
);
50-
};
52+
});
5153
}
5254

5355
#[derive(Deserialize, Message, Serialize)]

0 commit comments

Comments
 (0)