Skip to content

Commit

Permalink
tests: handle CLRF line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp15b committed Dec 29, 2024
1 parent ad3a217 commit 82bcc00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ struct TestFile {
impl TestFile {
fn parse(path: PathBuf) -> io::Result<Self> {
let test_file = fs::read_to_string(&path).unwrap();
let regex = Regex::new(r"//\s*(RUN|XFAIL|IGNORE): (.*)").unwrap();
// we enable CLRF mode for the regex to support both LF and CRLF line
// endings. this way, the matched command will never end with '\r'.
let regex = Regex::new(r"(?R)//\s*(RUN|XFAIL|IGNORE): (.*)").unwrap();
let commands = regex
.captures_iter(&test_file)
.map(|capture| {
Expand Down

0 comments on commit 82bcc00

Please sign in to comment.