Skip to content

Commit

Permalink
Fix benchmarks on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zsol committed May 28, 2022
1 parent 5900a4e commit b041f5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion native/libcst/benches/parser_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ use libcst_native::{
parse_module, parse_tokens_without_whitespace, tokenize, Codegen, Config, Inflate,
};

#[cfg(not(windows))]
const NEWLINE: &str = "\n";
#[cfg(windows)]
const NEWLINE: &str = "\r\n";

fn load_all_fixtures() -> String {
let mut path = PathBuf::from(file!());
path.pop();
Expand All @@ -38,7 +43,7 @@ fn load_all_fixtures() -> String {
let path = file.unwrap().path();
std::fs::read_to_string(&path).expect("reading_file")
})
.join("\n")
.join(NEWLINE)
}

pub fn inflate_benchmarks<T: Measurement>(c: &mut Criterion<T>) {
Expand Down

0 comments on commit b041f5f

Please sign in to comment.