Skip to content

Commit

Permalink
feat: test substituters by actually attempting to fetch from them
Browse files Browse the repository at this point in the history
  • Loading branch information
Erin van der Veen committed Mar 6, 2024
1 parent 9a07e48 commit 8637b5f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/nix/substituters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,15 @@ mod tests {

assert!(substituters.is_ok());
}

/// This test gets the substituters and passes them along to the
/// NarInfo::fetch function to ensure they are correct.
#[test]
fn test_get_substituters() {
let store_path = "/nix/store/1gxz5nfzfnhyxjdyzi04r86sh61y4i00-hello-2.12.1";
let substituters = get_substituters("nixpkgs".to_owned()).unwrap();
let nar_info = crate::narinfo::NarInfo::fetch(store_path, &substituters);

assert!(nar_info.is_ok_and(|n| n.is_some_and(|n| n.store_path == store_path)))
}
}

0 comments on commit 8637b5f

Please sign in to comment.