chore: turn clippy on for test code (#4817)
This commit is contained in:
@@ -443,18 +443,14 @@ mod tests {
|
||||
let mut cache = CompletionCache::new();
|
||||
|
||||
// Add some test prompts
|
||||
let mut extension1_prompts = Vec::new();
|
||||
extension1_prompts.push("test_prompt1".to_string());
|
||||
extension1_prompts.push("test_prompt2".to_string());
|
||||
cache
|
||||
.prompts
|
||||
.insert("extension1".to_string(), extension1_prompts);
|
||||
cache.prompts.insert(
|
||||
"extension1".to_string(),
|
||||
vec!["test_prompt1".to_string(), "test_prompt2".to_string()],
|
||||
);
|
||||
|
||||
let mut extension2_prompts = Vec::new();
|
||||
extension2_prompts.push("other_prompt".to_string());
|
||||
cache
|
||||
.prompts
|
||||
.insert("extension2".to_string(), extension2_prompts);
|
||||
.insert("extension2".to_string(), vec!["other_prompt".to_string()]);
|
||||
|
||||
// Add prompt info with arguments
|
||||
let test_prompt1_args = vec![
|
||||
@@ -519,7 +515,7 @@ mod tests {
|
||||
let (pos, candidates) = completer.complete_slash_commands("/e").unwrap();
|
||||
assert_eq!(pos, 0);
|
||||
// There might be multiple commands starting with "e" like "/exit" and "/extension"
|
||||
assert!(candidates.len() >= 1);
|
||||
assert!(!candidates.is_empty());
|
||||
|
||||
// Test multiple matches
|
||||
let (pos, candidates) = completer.complete_slash_commands("/").unwrap();
|
||||
|
||||
@@ -34,7 +34,7 @@ fn test_format_result_data_for_display() {
|
||||
assert_eq!(format_result_data_for_display(&json!(true)), "true");
|
||||
assert_eq!(format_result_data_for_display(&json!(false)), "false");
|
||||
assert_eq!(format_result_data_for_display(&json!(42)), "42");
|
||||
assert_eq!(format_result_data_for_display(&json!(3.14)), "3.14");
|
||||
assert_eq!(format_result_data_for_display(&json!(3.41)), "3.41");
|
||||
assert_eq!(format_result_data_for_display(&json!(null)), "null");
|
||||
|
||||
let partial_obj = json!({
|
||||
|
||||
Reference in New Issue
Block a user