1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-12 00:02:28 +01:00

Change circle detection to use new more conservative method and run in main loop instead of before the loop

This commit is contained in:
Niklas Mohrin
2021-02-27 15:32:07 +01:00
committed by David Peter
parent a98811b6d7
commit 694b31909a
5 changed files with 55 additions and 42 deletions

View File

@@ -329,7 +329,7 @@ mod tests {
let input = Input::ordinary_file(file_path.as_os_str());
let dummy_stdin: &[u8] = &[];
let mut opened_input = input.open(dummy_stdin).unwrap();
let mut opened_input = input.open(dummy_stdin, None).unwrap();
self.assets
.get_syntax(None, &mut opened_input, &self.syntax_mapping)
@@ -343,7 +343,7 @@ mod tests {
let input = Input::from_reader(Box::new(BufReader::new(first_line.as_bytes())))
.with_name(Some(file_path.as_os_str()));
let dummy_stdin: &[u8] = &[];
let mut opened_input = input.open(dummy_stdin).unwrap();
let mut opened_input = input.open(dummy_stdin, None).unwrap();
self.assets
.get_syntax(None, &mut opened_input, &self.syntax_mapping)
@@ -367,7 +367,7 @@ mod tests {
fn syntax_for_stdin_with_content(&self, file_name: &str, content: &[u8]) -> String {
let input = Input::stdin().with_name(Some(OsStr::new(file_name)));
let mut opened_input = input.open(content).unwrap();
let mut opened_input = input.open(content, None).unwrap();
self.assets
.get_syntax(None, &mut opened_input, &self.syntax_mapping)
@@ -523,7 +523,7 @@ mod tests {
let input = Input::ordinary_file(file_path_symlink.as_os_str());
let dummy_stdin: &[u8] = &[];
let mut opened_input = input.open(dummy_stdin).unwrap();
let mut opened_input = input.open(dummy_stdin, None).unwrap();
assert_eq!(
test.assets