Skip to content

Commit

Permalink
Improve robustness of cache integration test (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
mre authored Nov 7, 2024
1 parent 6b53695 commit 4beec32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lychee-bin/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ mod cli {
"cache file should not exist before this test"
);

// run first without cache to generate the cache file
// Run first without cache to generate the cache file
test_cmd
.assert()
.stderr(contains(format!("[200] {}/\n", mock_server_ok.uri())))
Expand All @@ -1007,7 +1007,7 @@ mod cli {
mock_server_too_many_requests.uri()
)));

// check content of cache file
// Check content of cache file
let data = fs::read_to_string(&cache_file)?;

if data.is_empty() {
Expand All @@ -1018,8 +1018,8 @@ mod cli {
assert!(!data.contains(&format!("{}/,204", mock_server_no_content.uri())));
assert!(!data.contains(&format!("{}/,429", mock_server_too_many_requests.uri())));

// clear the cache file
fs::remove_file(&cache_file)?;
// Unconditionally remove the cache file
let _ = fs::remove_file(&cache_file);
Ok(())
}

Expand Down

0 comments on commit 4beec32

Please sign in to comment.