We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 959309a commit 1a053faCopy full SHA for 1a053fa
highlighter/src/fixtures.rs
@@ -26,9 +26,10 @@ macro_rules! wln {
26
27
pub fn check_fixture(path: impl AsRef<Path>, roundtrip: impl FnOnce(&str) -> String) {
28
let path = path.as_ref();
29
- let snapshot = fs::read_to_string(path)
30
- .unwrap_or_default()
31
- .replace("\r\n", "\n");
+ let snapshot = match fs::read_to_string(path) {
+ Ok(content) => content.replace("\r\n", "\n"),
+ Err(err) => panic!("Failed to read fixture {path:?}: {err}"),
32
+ };
33
let snapshot = snapshot.trim_end();
34
let roundtrip = roundtrip(snapshot);
35
if snapshot != roundtrip.trim_end() {
0 commit comments