Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: JackTan25 <jacktby@gmail.com>
  • Loading branch information
JackTan25 committed Jul 24, 2023
1 parent 74218af commit c9f23f6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions sqllogictest/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,6 @@ pub enum TestErrorKind {
expected_err: String,
kind: RecordKind,
},
#[error(
"{kind} is expected to fail with error:\n\t{expected_err}\nbut pass test\n[SQL] {sql}"
)]
MismatchPass {
sql: String,
expected_err: String,
kind: RecordKind,
},
#[error("statement is expected to affect {expected} rows, but actually {actual}\n[SQL] {sql}")]
StatementResultMismatch {
sql: String,
Expand Down Expand Up @@ -697,9 +689,8 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
RecordOutput::Query { error: None, .. },
) => {
if expected_error.is_some() {
return Err(TestErrorKind::MismatchPass {
return Err(TestErrorKind::Ok {
sql,
expected_err: expected_error.unwrap().to_string(),
kind: RecordKind::Query,
}
.at(loc));
Expand All @@ -710,10 +701,18 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
expected_results,
loc,
sql,
expected_error,
..
},
RecordOutput::Statement { error: None, .. },
) => {
if expected_error.is_some() {
return Err(TestErrorKind::Ok {
sql,
kind: RecordKind::Query,
}
.at(loc));
}
if !expected_results.is_empty() {
return Err(TestErrorKind::QueryResultMismatch {
sql,
Expand Down

0 comments on commit c9f23f6

Please sign in to comment.