MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / test_error

Function test_error

flow-rs/tests/01-subgraph.rs:7–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6#[rt::test]
7async fn test_error() -> Result<()> {
8 let mut graph = Builder::default()
9 .template(
10 r#"
11main="test"
12[[graphs]]
13name="sub"
14nodes=[
15 {name="a", ty="Transform"},
16 {name="b", ty="ErrorOpr"},
17 {name="c", ty="Transform"}
18]
19inputs=[{name="inp",cap=1,ports=["a:inp"]}]
20outputs=[{name="out",cap=1,ports=["c:out"]}]
21connections=[
22 {cap=1,ports=["a:out", "b:inp"]},
23 {cap=1,ports=["b:out", "c:inp"]}
24]
25[[graphs]]
26name="test"
27nodes=[
28 {name="a", ty="NeverOpr"},
29 {name="b", ty="sub"},
30 {name="c", ty="NoopConsumer"},
31]
32connections=[
33 {cap=1,ports=["a:out", "b:inp"]},
34 {cap=1,ports=["b:out", "c:inp"]}
35]
36 "#
37 .to_owned(),
38 )
39 .build()?;
40 assert!(graph.start().await.is_err());
41 Ok(())
42}
43
44#[rt::test]
45async fn test_basis() -> Result<()> {

Callers

nothing calls this directly

Calls 2

templateMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected