diff --git a/tests/by-util/test_dd.rs b/tests/by-util/test_dd.rs index a3876e2d8..0c78d13af 100644 --- a/tests/by-util/test_dd.rs +++ b/tests/by-util/test_dd.rs @@ -438,6 +438,7 @@ fn test_zeros_to_file() { let tname = "zero-256k"; let test_fn = format!("{}.txt", tname); let tmp_fn = format!("TESTFILE-{}.tmp", &tname); + assert_fixture_exists!(test_fn); let (fix, mut ucmd) = at_and_ucmd!(); ucmd.args(&["status=none", inf!(test_fn), of!(tmp_fn)]) @@ -457,6 +458,7 @@ fn test_to_file_with_ibs_obs() { let tname = "zero-256k"; let test_fn = format!("{}.txt", tname); let tmp_fn = format!("TESTFILE-{}.tmp", &tname); + assert_fixture_exists!(test_fn); let (fix, mut ucmd) = at_and_ucmd!(); ucmd.args(&[ @@ -529,6 +531,7 @@ fn test_ascii_5_gibi_to_file() { #[test] fn test_self_transfer() { let fname = "self-transfer-256k.txt"; + assert_fixture_exists!(fname); let (fix, mut ucmd) = at_and_ucmd!(); ucmd.args(&["status=none", "conv=notrunc", inf!(fname), of!(fname)]); @@ -542,5 +545,29 @@ fn test_self_transfer() { assert_eq!(256 * 1024, fix.metadata(fname).len()); } +#[test] +fn test_unicode_filenames() { + let tname = "😎💚🦊"; + let test_fn = format!("{}.txt", tname); + let tmp_fn = format!("TESTFILE-{}.tmp", &tname); + assert_fixture_exists!(test_fn); + + let (fix, mut ucmd) = at_and_ucmd!(); + ucmd.args(&[ + "status=none", + inf!(test_fn), + of!(tmp_fn), + ]) + .run() + .no_stderr() + .no_stdout() + .success(); + + cmp_file!( + File::open(fixture_path!(&test_fn)).unwrap(), + fix.open(&tmp_fn) + ); +} + // conv=[ascii,ebcdic,ibm], conv=[ucase,lcase], conv=[block,unblock], conv=sync // TODO: Move conv tests from unit test module diff --git a/tests/fixtures/dd/😎💚🦊.txt b/tests/fixtures/dd/😎💚🦊.txt new file mode 100644 index 000000000..e69de29bb