team-ljyzipelo

공개

경로 어댑터의 Windows 전송 회귀 시험을 보완함

작성자
호시노 히나타
작성 시각
커밋
d632abcbf83c2a457b99e2cf49a00e41c1daf85a
부모
1de33ae
이 시점의 파일 보기

변경된 파일 1개

+83-0
수정tests/rust-app-real-worker/formats.rs+83-0
@@ -1,9 +1,92 @@
11#![allow(dead_code)]
22#[path = "../../experiments/rust-ui-memory-app/src/archive_ui.rs"]
33mod archive_ui;
4추가: use zipelo_ui_memory_app::archive_path;
45mod adapter {
56 include!("../../experiments/rust-ui-memory-app/src/archive_process.rs");
67
8추가: #[cfg(windows)]
9추가: #[test]
10추가: fn all_worker_path_fields_use_the_same_safe_drive_conversion() {
11추가: use std::path::{Path, PathBuf};
12추가: let input = PathBuf::from(r"\\?\C:\fixture\archive.zip");
13추가: let output = PathBuf::from(r"\\?\C:\fixture\output");
14추가: let expected_input = Path::new(r"C:\fixture\archive.zip");
15추가: let expected_output = Path::new(r"C:\fixture\output");
16추가: let wire::Action::List { archive } = start_to_wire(ui::Start::List {
17추가: archive: input.clone(),
18추가: })
19추가: .action
20추가: else {
21추가: panic!("목록 요청 누락")
22추가: };
23추가: assert_eq!(archive.to_path().unwrap(), expected_input);
24추가: let wire::Action::Extract {
25추가: archive,
26추가: destination,
27추가: ..
28추가: } = start_to_wire(ui::Start::Extract {
29추가: archive: input.clone(),
30추가: destination: output.clone(),
31추가: selection: ui::Selection::All,
32추가: list_id: token(
33추가: ui::Format::Zip,
34추가: ui::SourceObject::Windows {
35추가: volume: 1,
36추가: file_id: [2; 16],
37추가: },
38추가: ),
39추가: gzip_output_name: None,
40추가: })
41추가: .action
42추가: else {
43추가: panic!("추출 요청 누락")
44추가: };
45추가: assert_eq!(archive.to_path().unwrap(), expected_input);
46추가: assert_eq!(destination.to_path().unwrap(), expected_output);
47추가: for aes256 in [false, true] {
48추가: let wire::Action::CreateZip {
49추가: sources,
50추가: output_file,
51추가: encryption,
52추가: ..
53추가: } = start_to_wire(ui::Start::CreateZip {
54추가: sources: vec![(input.clone(), "source.txt".into())],
55추가: output_file: output.clone(),
56추가: method: ui::Method::Deflate,
57추가: aes256,
58추가: })
59추가: .action
60추가: else {
61추가: panic!("생성 요청 누락")
62추가: };
63추가: assert_eq!(sources[0].path.to_path().unwrap(), expected_input);
64추가: assert_eq!(output_file.to_path().unwrap(), expected_output);
65추가: assert_eq!(
66추가: encryption,
67추가: if aes256 {
68추가: wire::Encryption::Aes256
69추가: } else {
70추가: wire::Encryption::None
71추가: }
72추가: );
73추가: }
74추가: for text in [
75추가: r"\\?\UNC\server\share\one.zip",
76추가: r"\\server\share\one.zip",
77추가: r"\\?\C:\a\..\one.zip",
78추가: ] {
79추가: let wire::Action::List { archive } = start_to_wire(ui::Start::List {
80추가: archive: text.into(),
81추가: })
82추가: .action
83추가: else {
84추가: panic!("목록 요청 누락")
85추가: };
86추가: assert!(archive.to_path().is_err());
87추가: }
88추가: }
89추가:
790 fn token(format: ui::Format, source_object: ui::SourceObject) -> ui::ListId {
891 ui::ListId {
992 catalog_version: 1,