mirror of
https://github.com/isar/rusqlite.git
synced 2025-03-26 15:26:03 +08:00
Test invalid batch
This commit is contained in:
parent
ea8563ee59
commit
f776c770ab
16
src/lib.rs
16
src/lib.rs
@ -2213,6 +2213,22 @@ mod test {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_invalid_batch() -> Result<()> {
|
||||||
|
let db = Connection::open_in_memory()?;
|
||||||
|
let sql = r"
|
||||||
|
PRAGMA test1;
|
||||||
|
PRAGMA test2=?;
|
||||||
|
PRAGMA test3;
|
||||||
|
";
|
||||||
|
let mut batch = Batch::new(&db, sql);
|
||||||
|
assert!(batch.next().is_ok());
|
||||||
|
assert!(batch.next().is_err());
|
||||||
|
assert!(batch.next().is_err());
|
||||||
|
assert!(Batch::new(&db, sql).count().is_err());
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(feature = "modern_sqlite")]
|
#[cfg(feature = "modern_sqlite")]
|
||||||
fn test_returning() -> Result<()> {
|
fn test_returning() -> Result<()> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user