Skip to content

Commit e3ca4c3

Browse files
committed
fix(tests): enhance error message assertions for prepared statement tests
1 parent 0a43560 commit e3ca4c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/odbc/odbc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,10 +1180,13 @@ async fn it_handles_prepared_statement_with_wrong_parameter_count() -> anyhow::R
11801180
let Err(sqlx_oldapi::Error::Database(err)) = result else {
11811181
panic!("should be an error, got {:?}", result);
11821182
};
1183+
let err_str = err.to_string().to_lowercase();
11831184
// https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/appendix-a-odbc-error-codes?view=sql-server-ver17
11841185
// 07002 -> COUNT field incorrect
11851186
assert!(
1186-
err.to_string().contains("07002"),
1187+
err_str.contains("07002")
1188+
|| err_str.contains("parameter count")
1189+
|| err_str.contains("unbound parameter"),
11871190
"{:?} should contain '07002' (COUNT field incorrect)",
11881191
err
11891192
);

0 commit comments

Comments
 (0)