diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 37942b4..6a9502f 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -77,7 +77,7 @@ jobs: shell: bash run: | case ${{ matrix.job.target }} in - arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;; + arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf python3 ;; esac - name: Initialize workflow variables id: vars diff --git a/tests/integration.rs b/tests/integration.rs index e853b15..6f35c55 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -362,6 +362,42 @@ fn test_version_sort_overwrite_by_sizesort() { .stdout(predicate::str::is_match("11\n2\n$").unwrap()); } +#[test] +#[cfg(target_os = "linux")] +fn test_bad_utf_8_extension() { + let tmp = tempdir(); + Command::new("python3") + .arg("-c") + .arg(format!( + r#"import pathlib; pathlib.Path('{}/bad.extension\udca7\udcfd').touch()"#, + tmp.path().to_str().unwrap() + )) + .output() + .expect("failed to create file"); + cmd() + .arg(tmp.path()) + .assert() + .stdout(predicate::str::is_match("bad.extension\u{fffd}\u{fffd}\n$").unwrap()); +} + +#[test] +#[cfg(target_os = "linux")] +fn test_bad_utf_8_name() { + let tmp = tempdir(); + Command::new("python3") + .arg("-c") + .arg(format!( + r#"import pathlib; pathlib.Path('{}/bad-name\udca7\udcfd.ext').touch()"#, + tmp.path().to_str().unwrap() + )) + .output() + .expect("failed to create file"); + cmd() + .arg(tmp.path()) + .assert() + .stdout(predicate::str::is_match("bad-name\u{fffd}\u{fffd}.ext\n$").unwrap()); +} + fn cmd() -> Command { Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap() }