Cosmetic changes in tests

This commit is contained in:
gwenn 2022-11-11 16:32:42 +01:00
parent 784ef95bb6
commit 503f02ee01
3 changed files with 15 additions and 15 deletions

View File

@ -820,9 +820,9 @@ mod test {
FunctionFlags::SQLITE_UTF8 | FunctionFlags::SQLITE_DETERMINISTIC, FunctionFlags::SQLITE_UTF8 | FunctionFlags::SQLITE_DETERMINISTIC,
half, half,
)?; )?;
let result: Result<f64> = db.one_column("SELECT half(6)"); let result: f64 = db.one_column("SELECT half(6)")?;
assert!((3f64 - result?).abs() < f64::EPSILON); assert!((3f64 - result).abs() < f64::EPSILON);
Ok(()) Ok(())
} }
@ -835,8 +835,8 @@ mod test {
FunctionFlags::SQLITE_UTF8 | FunctionFlags::SQLITE_DETERMINISTIC, FunctionFlags::SQLITE_UTF8 | FunctionFlags::SQLITE_DETERMINISTIC,
half, half,
)?; )?;
let result: Result<f64> = db.one_column("SELECT half(6)"); let result: f64 = db.one_column("SELECT half(6)")?;
assert!((3f64 - result?).abs() < f64::EPSILON); assert!((3f64 - result).abs() < f64::EPSILON);
db.remove_function("half", 1)?; db.remove_function("half", 1)?;
let result: Result<f64> = db.one_column("SELECT half(6)"); let result: Result<f64> = db.one_column("SELECT half(6)");
@ -885,14 +885,14 @@ mod test {
regexp_with_auxilliary, regexp_with_auxilliary,
)?; )?;
let result: Result<bool> = db.one_column("SELECT regexp('l.s[aeiouy]', 'lisa')"); let result: bool = db.one_column("SELECT regexp('l.s[aeiouy]', 'lisa')")?;
assert!(result?); assert!(result);
let result: Result<i64> = let result: i64 =
db.one_column("SELECT COUNT(*) FROM foo WHERE regexp('l.s[aeiouy]', x) == 1"); db.one_column("SELECT COUNT(*) FROM foo WHERE regexp('l.s[aeiouy]', x) == 1")?;
assert_eq!(2, result?); assert_eq!(2, result);
Ok(()) Ok(())
} }

View File

@ -1267,9 +1267,9 @@ mod test {
let path_string = path.to_str().unwrap(); let path_string = path.to_str().unwrap();
let db = Connection::open(path_string)?; let db = Connection::open(path_string)?;
let the_answer: Result<i64> = db.one_column("SELECT x FROM foo"); let the_answer: i64 = db.one_column("SELECT x FROM foo")?;
assert_eq!(42i64, the_answer?); assert_eq!(42i64, the_answer);
Ok(()) Ok(())
} }
@ -1324,9 +1324,9 @@ mod test {
} }
let db = Connection::open(&db_path)?; let db = Connection::open(&db_path)?;
let the_answer: Result<i64> = db.one_column("SELECT x FROM foo"); let the_answer: i64 = db.one_column("SELECT x FROM foo")?;
assert_eq!(42i64, the_answer?); assert_eq!(42i64, the_answer);
Ok(()) Ok(())
} }

View File

@ -109,8 +109,8 @@ mod test {
tx2.commit().unwrap(); tx2.commit().unwrap();
}); });
assert_eq!(tx.recv().unwrap(), 1); assert_eq!(tx.recv().unwrap(), 1);
let the_answer: Result<i64> = db1.one_column("SELECT x FROM foo"); let the_answer: i64 = db1.one_column("SELECT x FROM foo")?;
assert_eq!(42i64, the_answer?); assert_eq!(42i64, the_answer);
child.join().unwrap(); child.join().unwrap();
Ok(()) Ok(())
} }