| | @@ -1,9 +1,92 @@ |
| 1 | 1 | #![allow(dead_code)] |
| 2 | 2 | #[path = "../../experiments/rust-ui-memory-app/src/archive_ui.rs"] |
| 3 | 3 | mod archive_ui; |
| 4 | +추가: use zipelo_ui_memory_app::archive_path; |
| 4 | 5 | mod adapter { |
| 5 | 6 | include!("../../experiments/rust-ui-memory-app/src/archive_process.rs"); |
| 6 | 7 | |
| 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 | +추가: |
| 7 | 90 | fn token(format: ui::Format, source_object: ui::SourceObject) -> ui::ListId { |
| 8 | 91 | ui::ListId { |
| 9 | 92 | catalog_version: 1, |