This commit is contained in:
gwenn 2023-08-26 10:58:58 +00:00
parent 5e79f84b37
commit 36f2459393

View File

@ -142,7 +142,9 @@ mod test {
let db = Connection::open_in_memory()?; let db = Connection::open_in_memory()?;
db.execute_batch("CREATE TABLE x AS SELECT 'data'")?; db.execute_batch("CREATE TABLE x AS SELECT 'data'")?;
let data = db.serialize(DatabaseName::Main)?; let data = db.serialize(DatabaseName::Main)?;
let Data::Owned(data) = data else { panic!("expected OwnedData")}; let Data::Owned(data) = data else {
panic!("expected OwnedData")
};
assert!(data.sz > 0); assert!(data.sz > 0);
Ok(()) Ok(())
} }
@ -152,7 +154,9 @@ mod test {
let src = Connection::open_in_memory()?; let src = Connection::open_in_memory()?;
src.execute_batch("CREATE TABLE x AS SELECT 'data'")?; src.execute_batch("CREATE TABLE x AS SELECT 'data'")?;
let data = src.serialize(DatabaseName::Main)?; let data = src.serialize(DatabaseName::Main)?;
let Data::Owned(data) = data else { panic!("expected OwnedData")}; let Data::Owned(data) = data else {
panic!("expected OwnedData")
};
let mut dst = Connection::open_in_memory()?; let mut dst = Connection::open_in_memory()?;
dst.deserialize(DatabaseName::Main, data, false)?; dst.deserialize(DatabaseName::Main, data, false)?;