diff --git a/cat/test.rs b/cat/test.rs index 6524ddda9..9b2db581e 100644 --- a/cat/test.rs +++ b/cat/test.rs @@ -22,7 +22,7 @@ fn test_output_multi_files_print_all_chars() { fn test_stdin_squeeze() { let mut process= Command::new("build/cat").arg("-A").spawn().unwrap(); - process.stdin.take_unwrap().write(bytes!("\x00\x01\x02")).unwrap(); + process.stdin.take_unwrap().write(b"\x00\x01\x02").unwrap(); let po = process.wait_with_output().unwrap(); let out = str::from_utf8(po.output.as_slice()).unwrap(); @@ -33,7 +33,7 @@ fn test_stdin_squeeze() { fn test_stdin_number_non_blank() { let mut process = Command::new("build/cat").arg("-b").arg("-").spawn().unwrap(); - process.stdin.take_unwrap().write(bytes!("\na\nb\n\n\nc")).unwrap(); + process.stdin.take_unwrap().write(b"\na\nb\n\n\nc").unwrap(); let po = process.wait_with_output().unwrap(); let out = str::from_utf8(po.output.as_slice()).unwrap(); diff --git a/nl/test.rs b/nl/test.rs index 9ed7668bb..80f95e687 100644 --- a/nl/test.rs +++ b/nl/test.rs @@ -5,7 +5,7 @@ use std::str; fn test_stdin_nonewline() { let mut process = Command::new("build/nl").spawn().unwrap(); - process.stdin.take_unwrap().write(bytes!("No Newline")).unwrap(); + process.stdin.take_unwrap().write(b"No Newline").unwrap(); let po = process.wait_with_output().unwrap(); let out = str::from_utf8(po.output.as_slice()).unwrap(); @@ -17,7 +17,7 @@ fn test_stdin_newline() { let mut process = Command::new("build/nl").arg("-s").arg("-") .arg("-w").arg("1").spawn().unwrap(); - process.stdin.take_unwrap().write(bytes!("Line One\nLine Two\n")).unwrap(); + process.stdin.take_unwrap().write(b"Line One\nLine Two\n").unwrap(); let po = process.wait_with_output().unwrap(); let out = str::from_utf8(po.output.as_slice()).unwrap(); diff --git a/tr/test.rs b/tr/test.rs index e62e79ed9..b39c29ecb 100644 --- a/tr/test.rs +++ b/tr/test.rs @@ -15,31 +15,31 @@ fn run(input: &str, args: &[&'static str]) -> Vec { #[test] fn test_toupper() { let out = run("!abcd!", ["a-z", "A-Z"]); - assert_eq!(out.as_slice(), bytes!("!ABCD!")); + assert_eq!(out.as_slice(), b"!ABCD!"); } #[test] fn test_small_set2() { let out = run("@0123456789", ["0-9", "X"]); - assert_eq!(out.as_slice(), bytes!("@XXXXXXXXXX")); + assert_eq!(out.as_slice(), b"@XXXXXXXXXX"); } #[test] fn test_unicode() { let out = run("(,°□°), ┬─┬", [", ┬─┬", "╯︵┻━┻"]); - assert_eq!(out.as_slice(), bytes!("(╯°□°)╯︵┻━┻")); + assert_eq!(out.as_slice(), "(╯°□°)╯︵┻━┻".as_bytes()); } #[test] fn test_delete() { let out = run("aBcD", ["-d", "a-z"]); - assert_eq!(out.as_slice(), bytes!("BD")); + assert_eq!(out.as_slice(), b"BD"); } #[test] fn test_delete_complement() { let out = run("aBcD", ["-d", "-c", "a-z"]); - assert_eq!(out.as_slice(), bytes!("ac")); + assert_eq!(out.as_slice(), b"ac"); } diff --git a/truncate/test.rs b/truncate/test.rs index 8de1adbb7..d549724eb 100644 --- a/truncate/test.rs +++ b/truncate/test.rs @@ -28,7 +28,7 @@ fn test_increase_file_size() { #[test] fn test_decrease_file_size() { let mut file = make_file(TFILE2); - file.write(bytes!("1234567890")).unwrap(); + file.write(b"1234567890").unwrap(); if !Command::new(PROG).args(["--size=-4", TFILE2]).status().unwrap().success() { fail!(); }