()
| 5019 | |
| 5020 | #[test] |
| 5021 | fn test_malformed_call_iterate() { |
| 5022 | let context1 = create_unchecked_context().unwrap(); |
| 5023 | let graph1 = context1.create_graph().unwrap(); |
| 5024 | let output = graph1.create_tuple(vec![]).unwrap(); |
| 5025 | graph1.set_output_node(output).unwrap(); |
| 5026 | let graph2 = context1.create_graph().unwrap(); |
| 5027 | let e1 = graph2.call(graph1.clone(), vec![]); |
| 5028 | assert!(e1.is_err()); |
| 5029 | graph1.finalize().unwrap(); |
| 5030 | graph2.call(graph1.clone(), vec![]).unwrap(); |
| 5031 | let context2 = create_unchecked_context().unwrap(); |
| 5032 | let graph3 = context2.create_graph().unwrap(); |
| 5033 | let e2 = graph3.call(graph1.clone(), vec![]); |
| 5034 | assert!(e2.is_err()); |
| 5035 | let graph4 = context1.create_graph().unwrap(); |
| 5036 | graph4.input(tuple_type(vec![])).unwrap(); |
| 5037 | graph4.input(tuple_type(vec![])).unwrap(); |
| 5038 | let t = graph4.create_tuple(vec![]).unwrap(); |
| 5039 | let tt = graph4.create_tuple(vec![t.clone(), t.clone()]).unwrap(); |
| 5040 | graph4.set_output_node(tt).unwrap(); |
| 5041 | let graph5 = context1.create_graph().unwrap(); |
| 5042 | let es = graph5.create_tuple(vec![]).unwrap(); |
| 5043 | let v = graph5 |
| 5044 | .repeat(graph5.create_tuple(vec![]).unwrap(), 10) |
| 5045 | .unwrap(); |
| 5046 | let e3 = graph5.iterate(graph4.clone(), es.clone(), v.clone()); |
| 5047 | assert!(e3.is_err()); |
| 5048 | graph4.finalize().unwrap(); |
| 5049 | graph5 |
| 5050 | .iterate(graph4.clone(), es.clone(), v.clone()) |
| 5051 | .unwrap(); |
| 5052 | let graph6 = context2.create_graph().unwrap(); |
| 5053 | let es = graph6.create_tuple(vec![]).unwrap(); |
| 5054 | let v = graph6 |
| 5055 | .repeat(graph6.create_tuple(vec![]).unwrap(), 10) |
| 5056 | .unwrap(); |
| 5057 | let e4 = graph6.iterate(graph4.clone(), es.clone(), v.clone()); |
| 5058 | assert!(e4.is_err()); |
| 5059 | } |
| 5060 | |
| 5061 | #[test] |
| 5062 | fn test_graph_consistency() { |
nothing calls this directly
no test coverage detected