Skip to content

Commit

Permalink
test: Add regression tests for #159
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jun 4, 2024
1 parent e052842 commit fce5e0a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1793,4 +1793,20 @@ mod test {
let mut reader = ZipArchive::new(Cursor::new(v)).unwrap();
reader.by_name("七个房间.txt").unwrap();
}

#[test]
fn test_utf8() {
let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/linux-7z.zip"));
let mut reader = ZipArchive::new(Cursor::new(v)).unwrap();
reader.by_name("你好.txt").unwrap();
}

#[test]
fn test_utf8_2() {
let mut v = Vec::new();
v.extend_from_slice(include_bytes!("../tests/data/windows-7zip.zip"));
let mut reader = ZipArchive::new(Cursor::new(v)).unwrap();
reader.by_name("你好.txt").unwrap();
}
}
Binary file added tests/data/linux-7z.zip
Binary file not shown.
Binary file added tests/data/windows-7zip.zip
Binary file not shown.

0 comments on commit fce5e0a

Please sign in to comment.