Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ impl Tool for OpenBitFunControlTool {
},
"value_null": {
"type": "boolean",
"enum": [true],
"description": "Set a nullable option to null; pass true."
},
"cursor": {
Expand Down Expand Up @@ -848,9 +847,25 @@ mod tests {
let schema = OpenBitFunControlTool::new().input_schema();
assert_eq!(schema["properties"]["value_boolean"]["type"], "boolean");
assert_eq!(schema["properties"]["value_integer"]["type"], "integer");
assert_eq!(schema["properties"]["value_null"]["type"], "boolean");
assert!(schema["properties"]["value_null"].get("enum").is_none());
assert!(schema["properties"].get("value").is_none());
}

#[test]
fn null_value_requires_true() {
assert_eq!(
OpenBitFunControlTool::configure_value(&json!({ "value_null": true })),
Ok(Some(Value::Null))
);
for value in [json!(false), json!(null), json!("true"), json!(1)] {
assert_eq!(
OpenBitFunControlTool::configure_value(&json!({ "value_null": value })),
Err("value_null must be true when used".to_string())
);
}
}

#[tokio::test]
async fn validates_the_discover_then_execute_contract() {
let tool = OpenBitFunControlTool::new();
Expand Down
Loading