Merge pull request #3266 from wada314/fix-2973

Fix issue #3265
This commit is contained in:
Seiichi Uchida 2018-12-25 18:00:45 +09:00 committed by GitHub
commit 84702bc289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View file

@ -1321,6 +1321,11 @@ impl<'a> Iterator for LineClasses<'a> {
}
}
// Workaround for CRLF newline.
if line.ends_with('\r') {
line.pop();
}
Some((self.kind, line))
}
}

View file

@ -0,0 +1,14 @@
// rustfmt-newline_style: Windows
#[cfg(test)]
mod test {
summary_test! {
tokenize_recipe_interpolation_eol,
"foo: # some comment
{{hello}}
",
"foo: \
{{hello}} \
{{ahah}}",
"N:#$>^{N}$<.",
}
}

View file

@ -0,0 +1,14 @@
// rustfmt-newline_style: Windows
#[cfg(test)]
mod test {
summary_test! {
tokenize_recipe_interpolation_eol,
"foo: # some comment
{{hello}}
",
"foo: \
{{hello}} \
{{ahah}}",
"N:#$>^{N}$<.",
}
}