1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 20:47:46 +00:00

Fix broken split tests.

I added a prefix to each test to isolate working files.
This commit is contained in:
Joseph Crail 2015-07-05 23:35:32 -04:00
parent 15fe464e4a
commit 7b5d800104

View file

@ -110,9 +110,9 @@ fn test_split_default() {
#[test] #[test]
fn test_split_num_prefixed_chunks_by_bytes() { fn test_split_num_prefixed_chunks_by_bytes() {
let name = "split_num_prefixed_chunks_by_bytes"; let name = "split_num_prefixed_chunks_by_bytes";
let glob = Glob::new(".", r"x\d\d$"); let glob = Glob::new(".", r"a\d\d$");
RandomFile::new(name).add_bytes(10000); RandomFile::new(name).add_bytes(10000);
if !Command::new(PROGNAME).args(&["-d", "-b", "1000", name]).status().unwrap().success() { if !Command::new(PROGNAME).args(&["-d", "-b", "1000", name, "a"]).status().unwrap().success() {
panic!(); panic!();
} }
assert_eq!(glob.count(), 10); assert_eq!(glob.count(), 10);
@ -123,9 +123,9 @@ fn test_split_num_prefixed_chunks_by_bytes() {
#[test] #[test]
fn test_split_str_prefixed_chunks_by_bytes() { fn test_split_str_prefixed_chunks_by_bytes() {
let name = "split_str_prefixed_chunks_by_bytes"; let name = "split_str_prefixed_chunks_by_bytes";
let glob = Glob::new(".", r"x[:alpha:][:alpha:]$"); let glob = Glob::new(".", r"b[:alpha:][:alpha:]$");
RandomFile::new(name).add_bytes(10000); RandomFile::new(name).add_bytes(10000);
if !Command::new(PROGNAME).args(&["-b", "1000", name]).status().unwrap().success() { if !Command::new(PROGNAME).args(&["-b", "1000", name, "b"]).status().unwrap().success() {
panic!(); panic!();
} }
assert_eq!(glob.count(), 10); assert_eq!(glob.count(), 10);
@ -136,9 +136,9 @@ fn test_split_str_prefixed_chunks_by_bytes() {
#[test] #[test]
fn test_split_num_prefixed_chunks_by_lines() { fn test_split_num_prefixed_chunks_by_lines() {
let name = "split_num_prefixed_chunks_by_lines"; let name = "split_num_prefixed_chunks_by_lines";
let glob = Glob::new(".", r"x\d\d$"); let glob = Glob::new(".", r"c\d\d$");
RandomFile::new(name).add_lines(10000); RandomFile::new(name).add_lines(10000);
if !Command::new(PROGNAME).args(&["-d", "-l", "1000", name]).status().unwrap().success() { if !Command::new(PROGNAME).args(&["-d", "-l", "1000", name, "c"]).status().unwrap().success() {
panic!(); panic!();
} }
assert_eq!(glob.count(), 10); assert_eq!(glob.count(), 10);
@ -149,9 +149,9 @@ fn test_split_num_prefixed_chunks_by_lines() {
#[test] #[test]
fn test_split_str_prefixed_chunks_by_lines() { fn test_split_str_prefixed_chunks_by_lines() {
let name = "split_str_prefixed_chunks_by_lines"; let name = "split_str_prefixed_chunks_by_lines";
let glob = Glob::new(".", r"x[:alpha:][:alpha:]$"); let glob = Glob::new(".", r"d[:alpha:][:alpha:]$");
RandomFile::new(name).add_lines(10000); RandomFile::new(name).add_lines(10000);
if !Command::new(PROGNAME).args(&["-l", "1000", name]).status().unwrap().success() { if !Command::new(PROGNAME).args(&["-l", "1000", name, "d"]).status().unwrap().success() {
panic!(); panic!();
} }
assert_eq!(glob.count(), 10); assert_eq!(glob.count(), 10);