autoformatting
This commit is contained in:
parent
00e3351c5c
commit
f8b1a0aeab
@ -84,11 +84,14 @@ fn test_table_derive_macro() {
|
|||||||
let err = Person::get_by_id(&conn, larry_id)
|
let err = Person::get_by_id(&conn, larry_id)
|
||||||
.expect_err("Querying a deleted row should Err(QueryReturnedNoRows)");
|
.expect_err("Querying a deleted row should Err(QueryReturnedNoRows)");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
err, rusqlite::Error::QueryReturnedNoRows,
|
err,
|
||||||
|
rusqlite::Error::QueryReturnedNoRows,
|
||||||
"Received row that should have been deleted"
|
"Received row that should have been deleted"
|
||||||
);
|
);
|
||||||
|
|
||||||
let id = larry.update_or_insert(&conn).expect("Upsertion (insert) should work");
|
let id = larry
|
||||||
|
.update_or_insert(&conn)
|
||||||
|
.expect("Upsertion (insert) should work");
|
||||||
let larry_id = larry
|
let larry_id = larry
|
||||||
.id
|
.id
|
||||||
.expect("After (mutable) upsertion, id should not be None");
|
.expect("After (mutable) upsertion, id should not be None");
|
||||||
@ -102,7 +105,9 @@ fn test_table_derive_macro() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
larry.age += 1;
|
larry.age += 1;
|
||||||
let id = larry.update_or_insert(&conn).expect("Upsertion (update) should work");
|
let id = larry
|
||||||
|
.update_or_insert(&conn)
|
||||||
|
.expect("Upsertion (update) should work");
|
||||||
let larry_id = larry
|
let larry_id = larry
|
||||||
.id
|
.id
|
||||||
.expect("After (mutable) upsertion, id should not be None");
|
.expect("After (mutable) upsertion, id should not be None");
|
||||||
@ -139,7 +144,6 @@ fn test_table_derive_macro() {
|
|||||||
.expect("Explicit Sqlite statement (not a library test) failed");
|
.expect("Explicit Sqlite statement (not a library test) failed");
|
||||||
assert!(!exists, "Deleted table should not exist anymore but does");
|
assert!(!exists, "Deleted table should not exist anymore but does");
|
||||||
|
|
||||||
|
|
||||||
/// Another example struct to assure this works more than once
|
/// Another example struct to assure this works more than once
|
||||||
#[derive(Table, Default)]
|
#[derive(Table, Default)]
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user