From b4177edd0984ecc40b2b8a6ba424e1d8e891ca1b Mon Sep 17 00:00:00 2001 From: Yaxin Cheng Date: Sun, 8 Jan 2023 19:31:40 -0500 Subject: [PATCH] Add test for listing archive files with Chinese characters --- tests/fixtures/chinese-name.zip | Bin 0 -> 354 bytes tests/integration_test.rs | 8 ++++++++ 2 files changed, 8 insertions(+) create mode 100644 tests/fixtures/chinese-name.zip diff --git a/tests/fixtures/chinese-name.zip b/tests/fixtures/chinese-name.zip new file mode 100644 index 0000000000000000000000000000000000000000..ebcb32bfb6fe445023c2e911a69481233bdadf03 GIT binary patch literal 354 zcmWIWW@Zs#VBlb2c%7;d#()Ia88jK5>{$D3TDyK|2qy#UYR28kAY59(&A`Y4QV1q0 zayS{-MVLYSw~hfgP2)qD1~l=>?ro$P%E%#UKs?03EMHM*si- literal 0 HcmV?d00001 diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 431e26b..4da4026 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -702,3 +702,11 @@ fn decode_failure() { panic!("Did not find expected error"); } + +#[test] +fn decode_chinese_zip() { + let source = std::fs::File::open("tests/fixtures/chinese-name.zip").unwrap(); + let files = list_archive_files(source).expect("Failed to list archives"); + let expected = ["中文/", "中文/文件/"]; + assert_eq!(files, expected); +}