Skip to content

Commit f914d8c

Browse files
🧪 Add test for ToolError::invalid_input
This commit introduces a unit test for the `ToolError::invalid_input` constructor to ensure it correctly maps to the `ToolError::InvalidInput` variant with the expected message. Co-authored-by: Hmbown <101357273+Hmbown@users.noreply.github.com>
1 parent 0181493 commit f914d8c

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎crates/tools/src/lib.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,4 +559,13 @@ mod tests {
559559
"Failed to validate input: missing required field 'path'"
560560
);
561561
}
562+
563+
#[test]
564+
fn tool_error_invalid_input_creates_correct_variant() {
565+
let err = ToolError::invalid_input("test invalid message");
566+
match err {
567+
ToolError::InvalidInput { message } => assert_eq!(message, "test invalid message"),
568+
_ => panic!("Expected ToolError::InvalidInput, got {:?}", err),
569+
}
570+
}
562571
}

0 commit comments

Comments
 (0)