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;
|
||||
assert_eq!(result.is_error, Some(false));
|
||||
let structured = result.structured_content.expect("structured present");
|
||||
let names: Vec<String> = structured
|
||||
let mut names: Vec<String> = structured
|
||||
.get("operations")
|
||||
.and_then(Value::as_array)
|
||||
.expect("operations array")
|
||||
.iter()
|
||||
.filter_map(|o| o.get("name").and_then(Value::as_str).map(str::to_string))
|
||||
.collect();
|
||||
names.sort();
|
||||
assert_eq!(
|
||||
names,
|
||||
vec!["fs/readFile".to_string(), "fs/writeFile".to_string()],
|
||||
|
||||
Reference in New Issue
Block a user