test: added additional test coverage to graph components

This commit is contained in:
2026-05-18 10:08:36 -06:00
parent 57c0f87e3d
commit adfab18f47
5 changed files with 143 additions and 2 deletions
+27
View File
@@ -468,6 +468,33 @@ mod tests {
assert!(state.state().get(OUTPUT_KEY).is_none());
}
#[test]
fn next_for_llm_node_success_routes_to_next() {
assert_eq!(
next_for_llm_node(Some("nx"), false, Some("fb")).unwrap(),
"nx"
);
}
#[test]
fn next_for_llm_node_failure_with_fallback_routes_to_fallback() {
assert_eq!(
next_for_llm_node(Some("nx"), true, Some("fb")).unwrap(),
"fb"
);
}
#[test]
fn next_for_llm_node_failure_without_fallback_routes_to_next() {
assert_eq!(next_for_llm_node(Some("nx"), true, None).unwrap(), "nx");
}
#[test]
fn next_for_llm_node_errors_without_next_or_fallback() {
assert!(next_for_llm_node(None, false, None).is_err());
assert!(next_for_llm_node(None, true, None).is_err());
}
fn node_with_schema(updates: Option<HashMap<String, String>>, schema: Value) -> LlmNode {
let mut n = node_with(updates);
n.output_schema = Some(schema);