Skip to content

Commit 5f8e40a

Browse files
committed
Implement XML parsing with default options
1 parent c17fab8 commit 5f8e40a

File tree

2 files changed

+237
-218
lines changed

2 files changed

+237
-218
lines changed

crates/core/src/runtime/nodes/common_nodes/status.rs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -53,64 +53,3 @@ impl ScopedNodeBehavior for StatusNode {
5353
&self.scope
5454
}
5555
}
56-
57-
#[cfg(test)]
58-
mod tests {
59-
use super::*;
60-
use serde::Deserialize;
61-
use serde_json::json;
62-
63-
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
64-
async fn test_status_node_default_scope() {
65-
let flows_json = json!([
66-
{"id": "100", "type": "tab"},
67-
{"id": "1", "z": "100", "type": "status", "name": "status-default", "wires": [["2"]]},
68-
{"id": "2", "z": "100", "type": "test-once"}
69-
]);
70-
let msgs_to_inject_json = json!([
71-
["1", {"payload": "hello"}]
72-
]);
73-
74-
let engine = crate::runtime::engine::build_test_engine(flows_json.clone()).unwrap();
75-
let msgs_to_inject = Vec::<(ElementId, Msg)>::deserialize(msgs_to_inject_json.clone()).unwrap();
76-
let msgs =
77-
engine.run_once_with_inject(2, std::time::Duration::from_secs_f64(0.2), msgs_to_inject).await.unwrap();
78-
assert_eq!(msgs.len(), 1);
79-
}
80-
81-
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
82-
async fn test_status_node_explicit_scope() {
83-
let flows_json = json!([
84-
{"id": "100", "type": "tab"},
85-
{"id": "1", "z": "100", "type": "status", "name": "status-global", "scope": "global", "wires": [["2"]]},
86-
{"id": "2", "z": "100", "type": "test-once"}
87-
]);
88-
let msgs_to_inject_json = json!([
89-
["1", {"payload": "world"}]
90-
]);
91-
92-
let engine = crate::runtime::engine::build_test_engine(flows_json.clone()).unwrap();
93-
let msgs_to_inject = Vec::<(ElementId, Msg)>::deserialize(msgs_to_inject_json.clone()).unwrap();
94-
let msgs =
95-
engine.run_once_with_inject(2, std::time::Duration::from_secs_f64(0.2), msgs_to_inject).await.unwrap();
96-
assert_eq!(msgs.len(), 1);
97-
}
98-
99-
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
100-
async fn test_status_node_scope_edge_case() {
101-
let flows_json = json!([
102-
{"id": "100", "type": "tab"},
103-
{"id": "1", "z": "100", "type": "status", "name": "status-unknown", "scope": "unknown", "wires": [["2"]]},
104-
{"id": "2", "z": "100", "type": "test-once"}
105-
]);
106-
let msgs_to_inject_json = json!([
107-
["1", {"payload": "edge"}]
108-
]);
109-
110-
let engine = crate::runtime::engine::build_test_engine(flows_json.clone()).unwrap();
111-
let msgs_to_inject = Vec::<(ElementId, Msg)>::deserialize(msgs_to_inject_json.clone()).unwrap();
112-
let msgs =
113-
engine.run_once_with_inject(2, std::time::Duration::from_secs_f64(0.2), msgs_to_inject).await.unwrap();
114-
assert_eq!(msgs.len(), 1);
115-
}
116-
}

0 commit comments

Comments
 (0)