diff --git a/src/lib.rs b/src/lib.rs index cafa767..911f3f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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<()> {