test(adapters): order-independent assert in MCP search filter test
This commit is contained in:
@@ -870,13 +870,14 @@ mod tests {
|
|||||||
let result = invoke_tool(&gateway, "search", Some(args), None).await;
|
let result = invoke_tool(&gateway, "search", Some(args), None).await;
|
||||||
assert_eq!(result.is_error, Some(false));
|
assert_eq!(result.is_error, Some(false));
|
||||||
let structured = result.structured_content.expect("structured present");
|
let structured = result.structured_content.expect("structured present");
|
||||||
let names: Vec<String> = structured
|
let mut names: Vec<String> = structured
|
||||||
.get("operations")
|
.get("operations")
|
||||||
.and_then(Value::as_array)
|
.and_then(Value::as_array)
|
||||||
.expect("operations array")
|
.expect("operations array")
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|o| o.get("name").and_then(Value::as_str).map(str::to_string))
|
.filter_map(|o| o.get("name").and_then(Value::as_str).map(str::to_string))
|
||||||
.collect();
|
.collect();
|
||||||
|
names.sort();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
names,
|
names,
|
||||||
vec!["fs/readFile".to_string(), "fs/writeFile".to_string()],
|
vec!["fs/readFile".to_string(), "fs/writeFile".to_string()],
|
||||||
|
|||||||
Reference in New Issue
Block a user