Test coverage and headless nvim bug fixes

This commit is contained in:
Riz Ashraf committed 2026-09-27 08:10:09 +01:00
1 parent bffc8896f1
commit 4bae4e9c08
9 files changed
+316 -58

No files matched your search

+23
View File
@@ -562,3 +562,26 @@ pub struct VerifyAcceptanceCriteriaTool {
pub criteria: String,
pub proof: String,
}
#[cfg(test)]
mod tests {
use super::*;
use schemars::schema_for;
#[test]
fn test_schema_extraction_includes_descriptions() {
let schema = schema_for!(SetAcceptanceCriteriaTool);
let schema_json = serde_json::to_value(&schema).unwrap();
let desc = schema_json.get("description").and_then(|d| d.as_str()).unwrap_or("");
assert!(desc.contains("Define a strict checklist of acceptance criteria"), "Schema should include struct docstring as description");
let schema2 = schema_for!(LogCodeChangeTool);
let schema2_json = serde_json::to_value(&schema2).unwrap();
let props = schema2_json.get("properties").expect("Missing properties");
let file_path_prop = props.get("file_path").expect("Missing file_path property");
let field_desc = file_path_prop.get("description").and_then(|d| d.as_str()).unwrap_or("");
assert!(field_desc.contains("The path of the file that was changed"), "Schema should include field docstring as description");
}
}