mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-01 06:18:54 +08:00
Make tests return Result
This commit is contained in:
@@ -122,13 +122,13 @@ impl Connection {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::DbConfig;
|
||||
use crate::Connection;
|
||||
use crate::{Connection, Result};
|
||||
|
||||
#[test]
|
||||
fn test_db_config() {
|
||||
let db = Connection::open_in_memory().unwrap();
|
||||
fn test_db_config() -> Result<()> {
|
||||
let db = Connection::open_in_memory()?;
|
||||
|
||||
let opposite = !db.db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_FKEY).unwrap();
|
||||
let opposite = !db.db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_FKEY)?;
|
||||
assert_eq!(
|
||||
db.set_db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_FKEY, opposite),
|
||||
Ok(opposite)
|
||||
@@ -138,9 +138,7 @@ mod test {
|
||||
Ok(opposite)
|
||||
);
|
||||
|
||||
let opposite = !db
|
||||
.db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_TRIGGER)
|
||||
.unwrap();
|
||||
let opposite = !db.db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_TRIGGER)?;
|
||||
assert_eq!(
|
||||
db.set_db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_TRIGGER, opposite),
|
||||
Ok(opposite)
|
||||
@@ -149,5 +147,6 @@ mod test {
|
||||
db.db_config(DbConfig::SQLITE_DBCONFIG_ENABLE_TRIGGER),
|
||||
Ok(opposite)
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user