Skip to content

Commit

Permalink
fix tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Oct 2, 2024
1 parent 8731ab0 commit 16df5f9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/partial_quicksync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ mod tests {
fn partial_restore() {
let dir = tempdir().unwrap();
let db_path = dir.path().join("state.db");
let conn = create_test_db(Some(&db_path));
insert_layer(&conn, 99, 100, &[0xBB, 0xBB]);
{
let conn = create_test_db(Some(&db_path));
insert_layer(&conn, 99, 100, &[0xBB, 0xBB]);
}

let mut server = mockito::Server::new();
let user_version = 0;
Expand Down Expand Up @@ -377,6 +379,7 @@ mod tests {
mock.assert();
}

let conn = Connection::open(&db_path).unwrap();
let latest = get_latest_from_db(&conn).unwrap();
assert_eq!(latest, points.last().unwrap().1.to - 1);

Expand All @@ -388,8 +391,10 @@ mod tests {
fn fails_on_hash_mismatch() {
let dir = tempdir().unwrap();
let db_path = dir.path().join("state.db");
let conn = create_test_db(Some(&db_path));
insert_layer(&conn, 99, 100, &[0xFF, 0xFF]);
{
let conn = create_test_db(Some(&db_path));
insert_layer(&conn, 99, 100, &[0xFF, 0xFF]);
}
let mut server = mockito::Server::new();
let user_version = 0;

Expand Down

0 comments on commit 16df5f9

Please sign in to comment.