Test invalid batch

This commit is contained in:
gwenn 2024-10-19 10:27:10 +02:00
parent ea8563ee59
commit f776c770ab

View File

@ -2213,6 +2213,22 @@ mod test {
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]
#[cfg(feature = "modern_sqlite")]
fn test_returning() -> Result<()> {