fix: resolve clippy warnings and missing struct fields in tests
This commit is contained in:
1 parent
5f870be0d9
commit
c57e18bf3e
17 files changed
+49
-30
No files matched your search
@@ -2160,7 +2160,7 @@ mod tests {
|
||||
let escaped = pg_quote_ident(malicious);
|
||||
// Double quotes should be doubled, not breaking out
|
||||
assert_eq!(escaped, r#""public""; DROP TABLE users; --""#);
|
||||
assert!(escaped.matches('"').count() % 2 == 0, "quote count should be even");
|
||||
assert!(escaped.matches('"').count().is_multiple_of(2), "quote count should be even");
|
||||
}
|
||||
|
||||
// --- query_result_row_limit ---
|
||||
@@ -2479,14 +2479,14 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn execute_batch_whitespace_only_is_filtered() {
|
||||
let statements = vec![" ".to_string(), "\t\n".to_string(), "".to_string()];
|
||||
let statements = [" ".to_string(), "\t\n".to_string(), "".to_string()];
|
||||
let combined = statements.iter().map(|s| s.trim()).filter(|s| !s.is_empty()).collect::<Vec<_>>().join(";\n");
|
||||
assert!(combined.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn execute_batch_joins_with_semicolons() {
|
||||
let statements = vec!["SELECT 1".to_string(), "SELECT 2".to_string()];
|
||||
let statements = ["SELECT 1".to_string(), "SELECT 2".to_string()];
|
||||
let combined = statements.iter().map(|s| s.trim()).filter(|s| !s.is_empty()).collect::<Vec<_>>().join(";\n");
|
||||
assert_eq!(combined, "SELECT 1;\nSELECT 2");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user