diff --git a/src/ptx/ptx.rs b/src/ptx/ptx.rs index 377583c32..ac9731591 100644 --- a/src/ptx/ptx.rs +++ b/src/ptx/ptx.rs @@ -238,7 +238,7 @@ fn create_word_set(config: &Config, filter: &WordFilter, // if -r, exclude reference from word set let (ref_beg, ref_end) = match ref_reg.find(line) { Some(x) => (x.start(), x.end()), - None => (0,0) + None => (0, 0) }; // match words with given regex for mat in reg.find_iter(line) { @@ -281,7 +281,7 @@ fn get_reference(config: &Config, word_ref: &WordRef, line: &str) -> let reg = Regex::new(&config.context_regex).unwrap(); let (beg, end) = match reg.find(line) { Some(x) => (x.start(), x.end()), - None => (0,0) + None => (0, 0) }; format!("{}", &line[beg .. end]) } else { diff --git a/tests/test_split.rs b/tests/test_split.rs index 5903485e2..cae56b606 100644 --- a/tests/test_split.rs +++ b/tests/test_split.rs @@ -93,7 +93,7 @@ impl RandomFile { fn test_split_default() { let (at, mut ucmd) = at_and_ucmd!(); let name = "split_default"; - let glob = Glob::new(&at, ".", r"x[:alpha:][:alpha:]$"); + let glob = Glob::new(&at, ".", r"x[[:alpha:]][[:alpha:]]$"); RandomFile::new(&at, name).add_lines(2000); ucmd.args(&[name]).succeeds(); assert_eq!(glob.count(), 2); @@ -115,7 +115,7 @@ fn test_split_num_prefixed_chunks_by_bytes() { fn test_split_str_prefixed_chunks_by_bytes() { let (at, mut ucmd) = at_and_ucmd!(); let name = "split_str_prefixed_chunks_by_bytes"; - let glob = Glob::new(&at, ".", r"b[:alpha:][:alpha:]$"); + let glob = Glob::new(&at, ".", r"b[[:alpha:]][[:alpha:]]$"); RandomFile::new(&at, name).add_bytes(10000); ucmd.args(&["-b", "1000", name, "b"]).succeeds(); assert_eq!(glob.count(), 10); @@ -137,7 +137,7 @@ fn test_split_num_prefixed_chunks_by_lines() { fn test_split_str_prefixed_chunks_by_lines() { let (at, mut ucmd) = at_and_ucmd!(); let name = "split_str_prefixed_chunks_by_lines"; - let glob = Glob::new(&at, ".", r"d[:alpha:][:alpha:]$"); + let glob = Glob::new(&at, ".", r"d[[:alpha:]][[:alpha:]]$"); RandomFile::new(&at, name).add_lines(10000); ucmd.args(&["-l", "1000", name, "d"]).succeeds(); assert_eq!(glob.count(), 10);