Merge pull request #1584 from gwenn/batch

Test invalid batch
This commit is contained in:
gwenn 2024-10-19 10:58:19 +02:00 committed by GitHub
commit 64773ffec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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<()> {