Merge pull request #2739 from thibaultdelor/fixWindowsTest

Fix test failing on windows due to crlf
This commit is contained in:
Nick Cameron 2018-05-28 10:13:09 +12:00 committed by GitHub
commit 0a2ec411ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -209,9 +209,9 @@ impl FileLines {
self.file_range_matches(file_name, |r| r.lo <= line && r.hi >= line)
}
/// Returns true if any of the lines between `lo` and `hi` from `file_name` are in `self`.
pub(crate) fn intersects_range(&self, file_name: &FileName, lo: usize, hi: usize) -> bool {
self.file_range_matches(file_name, |r| r.intersects(Range::new(lo, hi)))
/// Returns true if all the lines between `lo` and `hi` from `file_name` are in `self`.
pub(crate) fn contains_range(&self, file_name: &FileName, lo: usize, hi: usize) -> bool {
self.file_range_matches(file_name, |r| r.contains(Range::new(lo, hi)))
}
}

View file

@ -202,7 +202,7 @@ impl<'a> FmtVisitor<'a> {
debug!("{:?}: {:?}", kind, subslice);
let newline_count = count_newlines(subslice);
let within_file_lines_range = self.config.file_lines().intersects_range(
let within_file_lines_range = self.config.file_lines().contains_range(
file_name,
status.cur_line,
status.cur_line + newline_count,