Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend test_simple_delete to do one more delete
Browse files Browse the repository at this point in the history
krishvishal committed Jan 26, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d62395a commit 14486ab
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -529,6 +529,23 @@ mod tests {
}
};

let insert_query = "INSERT INTO test VALUES (2)";
match conn.query(insert_query) {
Ok(Some(ref mut rows)) => loop {
match rows.next_row()? {
StepResult::IO => {
tmp_db.io.run_once()?;
}
StepResult::Done => break,
_ => unreachable!(),
}
},
Ok(None) => {}
Err(err) => {
eprintln!("{}", err);
}
};

let delete_query = "DELETE FROM test WHERE x = 1;";
match conn.query(delete_query) {
Ok(Some(ref mut rows)) => loop {
@@ -546,6 +563,23 @@ mod tests {
}
};

let delete_query = "DELETE FROM test WHERE x = 2;";
match conn.query(delete_query) {
Ok(Some(ref mut rows)) => loop {
match rows.next_row()? {
StepResult::IO => {
tmp_db.io.run_once()?;
}
StepResult::Done => break,
_ => unreachable!(),
}
},
Ok(None) => {}
Err(err) => {
eprintln!("{}", err);
}
};

let count_query = "SELECT COUNT(*) FROM test;";
match conn.query(count_query) {
Ok(Some(ref mut rows)) => loop {

0 comments on commit 14486ab

Please sign in to comment.