GZ 저장 이름 선택과 대소문자 압축파일 필터를 수정함
- 작성자
- 호시노 히나타
- 작성 시각
- 커밋
0a0eef33e792890407cffca29251ff08f6399421- 부모
- 6d3da49
변경된 파일 10개
+305-18| @@ -8,6 +8,8 @@ pub enum Purpose { | ||
| 8 | 8 | Destination, |
| 9 | 9 | Retry, |
| 10 | 10 | SaveZip, |
| 11 | 추가: SaveGzip, | |
| 12 | 추가: RetryGzip, | |
| 11 | 13 | } |
| 12 | 14 | |
| 13 | 15 | #[derive(Clone, Debug)] |
| @@ -21,6 +23,25 @@ pub trait Dialogs { | ||
| 21 | 23 | fn choose(&mut self, request: DialogRequest) -> Result<Option<Vec<PathBuf>>, String>; |
| 22 | 24 | } |
| 23 | 25 | |
| 26 | 추가: pub fn archive_filters() -> Vec<(&'static str, Vec<String>)> { | |
| 27 | 추가: let mut extensions = Vec::new(); | |
| 28 | 추가: for extension in ["zip", "7z", "tar", "gz", "tgz"] { | |
| 29 | 추가: let mut variants = vec![String::new()]; | |
| 30 | 추가: for character in extension.chars() { | |
| 31 | 추가: let mut next = Vec::new(); | |
| 32 | 추가: for prefix in variants { | |
| 33 | 추가: next.push(format!("{prefix}{character}")); | |
| 34 | 추가: if character.is_ascii_alphabetic() { | |
| 35 | 추가: next.push(format!("{prefix}{}", character.to_ascii_uppercase())); | |
| 36 | 추가: } | |
| 37 | 추가: } | |
| 38 | 추가: variants = next; | |
| 39 | 추가: } | |
| 40 | 추가: extensions.extend(variants); | |
| 41 | 추가: } | |
| 42 | 추가: vec![("압축파일", extensions), ("모든 파일", vec!["*".into()])] | |
| 43 | 추가: } | |
| 44 | 추가: | |
| 24 | 45 | #[derive(Default)] |
| 25 | 46 | pub struct NativeDialogs; |
| 26 | 47 | |
| @@ -29,11 +50,13 @@ impl Dialogs for NativeDialogs { | ||
| 29 | 50 | let dialog = rfd::FileDialog::new().set_directory(request.directory); |
| 30 | 51 | let answer = |
| 31 | 52 | std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| match request.purpose { |
| 32 | 삭제: Purpose::Open => dialog | |
| 33 | 삭제: .set_title("압축파일 열기") | |
| 34 | 삭제: .add_filter("압축파일", &["zip", "7z", "tar", "gz", "tgz"]) | |
| 35 | 삭제: .pick_file() | |
| 36 | 삭제: .map(|path| vec![path]), | |
| 53 | 추가: Purpose::Open => { | |
| 54 | 추가: let mut dialog = dialog.set_title("압축파일 열기"); | |
| 55 | 추가: for (name, extensions) in archive_filters() { | |
| 56 | 추가: dialog = dialog.add_filter(name, &extensions); | |
| 57 | 추가: } | |
| 58 | 추가: dialog.pick_file().map(|path| vec![path]) | |
| 59 | 추가: } | |
| 37 | 60 | Purpose::Files => dialog.set_title("파일 추가").pick_files(), |
| 38 | 61 | Purpose::Folder => dialog |
| 39 | 62 | .set_title("폴더 추가") |
| @@ -43,6 +66,11 @@ impl Dialogs for NativeDialogs { | ||
| 43 | 66 | .set_title("압축을 풀 폴더 선택") |
| 44 | 67 | .pick_folder() |
| 45 | 68 | .map(|path| vec![path]), |
| 69 | 추가: Purpose::SaveGzip | Purpose::RetryGzip => dialog | |
| 70 | 추가: .set_title("압축 해제 파일 저장") | |
| 71 | 추가: .set_file_name(request.file_name) | |
| 72 | 추가: .save_file() | |
| 73 | 추가: .map(|path| vec![path]), | |
| 46 | 74 | Purpose::SaveZip => dialog |
| 47 | 75 | .set_title("ZIP 파일 저장") |
| 48 | 76 | .set_file_name(request.file_name) |
| @@ -362,3 +362,23 @@ pub fn activity_text(model: &Model, creating: bool) -> &'static str { | ||
| 362 | 362 | }) |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 추가: | |
| 366 | 추가: pub fn valid_output_leaf(name: &str) -> bool { | |
| 367 | 추가: valid_leaf(name) && worker_protocol::archive::valid_name(name, false).is_ok() | |
| 368 | 추가: } | |
| 369 | 추가: | |
| 370 | 추가: pub fn gzip_output_name(archive: &Path) -> String { | |
| 371 | 추가: let file_name = archive | |
| 372 | 추가: .file_name() | |
| 373 | 추가: .and_then(|name| name.to_str()) | |
| 374 | 추가: .unwrap_or(""); | |
| 375 | 추가: let candidate = file_name | |
| 376 | 추가: .rsplit_once('.') | |
| 377 | 추가: .filter(|(_, suffix)| suffix.eq_ignore_ascii_case("gz")) | |
| 378 | 추가: .map_or(file_name, |(stem, _)| stem); | |
| 379 | 추가: if valid_output_leaf(candidate) { | |
| 380 | 추가: candidate.to_owned() | |
| 381 | 추가: } else { | |
| 382 | 추가: "압축 해제 파일".into() | |
| 383 | 추가: } | |
| 384 | 추가: } |
| @@ -112,13 +112,7 @@ impl ArchiveApp { | ||
| 112 | 112 | self.clear_password(); |
| 113 | 113 | self.destination = present::default_destination(&archive); |
| 114 | 114 | self.automatic_destination = true; |
| 115 | 삭제: self.gzip_name = archive | |
| 116 | 삭제: .file_name() | |
| 117 | 삭제: .unwrap_or_default() | |
| 118 | 삭제: .to_string_lossy() | |
| 119 | 삭제: .strip_suffix(".gz") | |
| 120 | 삭제: .unwrap_or("압축 해제 파일") | |
| 121 | 삭제: .into(); | |
| 115 | 추가: self.gzip_name = present::gzip_output_name(&archive); | |
| 122 | 116 | self.selected_only = false; |
| 123 | 117 | self.folder.clear(); |
| 124 | 118 | self.search.clear(); |
| @@ -286,16 +280,26 @@ impl ArchiveApp { | ||
| 286 | 280 | if self.model.busy() { |
| 287 | 281 | return; |
| 288 | 282 | } |
| 283 | 추가: let gzip = self | |
| 284 | 추가: .model | |
| 285 | 추가: .list_id | |
| 286 | 추가: .as_ref() | |
| 287 | 추가: .is_some_and(|id| id.format == Format::Gzip); | |
| 288 | 추가: let purpose = match (purpose, gzip) { | |
| 289 | 추가: (Purpose::Destination, true) => Purpose::SaveGzip, | |
| 290 | 추가: (Purpose::Retry, true) => Purpose::RetryGzip, | |
| 291 | 추가: _ => purpose, | |
| 292 | 추가: }; | |
| 289 | 293 | let directory = match purpose { |
| 290 | 294 | Purpose::SaveZip => self.zip_folder.clone(), |
| 291 | 삭제: Purpose::Destination => self | |
| 295 | 추가: Purpose::Destination | Purpose::SaveGzip => self | |
| 292 | 296 | .model |
| 293 | 297 | .archive |
| 294 | 298 | .as_ref() |
| 295 | 299 | .and_then(|path| path.parent()) |
| 296 | 300 | .map(Path::to_path_buf) |
| 297 | 301 | .unwrap_or_else(present::home_directory), |
| 298 | 삭제: Purpose::Retry => self.destination.clone(), | |
| 302 | 추가: Purpose::Retry | Purpose::RetryGzip => self.destination.clone(), | |
| 299 | 303 | _ => self |
| 300 | 304 | .sources |
| 301 | 305 | .last() |
| @@ -306,7 +310,11 @@ impl ArchiveApp { | ||
| 306 | 310 | let request = DialogRequest { |
| 307 | 311 | purpose, |
| 308 | 312 | directory, |
| 309 | 삭제: file_name: self.zip_name.clone(), | |
| 313 | 추가: file_name: if matches!(purpose, Purpose::SaveGzip | Purpose::RetryGzip) { | |
| 314 | 추가: self.gzip_name.clone() | |
| 315 | 추가: } else { | |
| 316 | 추가: self.zip_name.clone() | |
| 317 | 추가: }, | |
| 310 | 318 | }; |
| 311 | 319 | match self.dialogs.choose(request) { |
| 312 | 320 | Ok(Some(paths)) if !paths.is_empty() => { |
| @@ -331,6 +339,33 @@ impl ArchiveApp { | ||
| 331 | 339 | self.begin_extract(); |
| 332 | 340 | } |
| 333 | 341 | } |
| 342 | 추가: Purpose::SaveGzip | Purpose::RetryGzip => { | |
| 343 | 추가: let Some(name) = path.file_name().and_then(|name| name.to_str()) else { | |
| 344 | 추가: self.ui_error = Some("저장할 파일 이름을 확인하세요".into()); | |
| 345 | 추가: return; | |
| 346 | 추가: }; | |
| 347 | 추가: if !present::valid_output_leaf(name) { | |
| 348 | 추가: self.ui_error = Some("저장할 파일 이름을 확인하세요".into()); | |
| 349 | 추가: return; | |
| 350 | 추가: } | |
| 351 | 추가: let name = name.to_owned(); | |
| 352 | 추가: self.choose_destination( | |
| 353 | 추가: path.parent().unwrap_or(Path::new("/")).to_path_buf(), | |
| 354 | 추가: ); | |
| 355 | 추가: self.gzip_name = name.clone(); | |
| 356 | 추가: self.selected_only = !self.model.selected.is_empty(); | |
| 357 | 추가: if purpose == Purpose::RetryGzip { | |
| 358 | 추가: if let Some(Start::Extract { | |
| 359 | 추가: gzip_output_name, .. | |
| 360 | 추가: }) = &mut self.last_request | |
| 361 | 추가: { | |
| 362 | 추가: *gzip_output_name = Some(name); | |
| 363 | 추가: } | |
| 364 | 추가: self.retry(); | |
| 365 | 추가: } else { | |
| 366 | 추가: self.begin_extract(); | |
| 367 | 추가: } | |
| 368 | 추가: } | |
| 334 | 369 | Purpose::SaveZip => { |
| 335 | 370 | if let Some(name) = path.file_name().and_then(|name| name.to_str()) { |
| 336 | 371 | self.zip_name = name.to_owned(); |
| @@ -1027,7 +1062,19 @@ impl ArchiveApp { | ||
| 1027 | 1062 | let action = if success { |
| 1028 | 1063 | Some(("폴더 열기", true)) |
| 1029 | 1064 | } else if conflict { |
| 1030 | 삭제: Some(("다른 폴더에 풀기", !uncertain || self.checked_destination)) | |
| 1065 | 추가: Some(( | |
| 1066 | 추가: if self | |
| 1067 | 추가: .model | |
| 1068 | 추가: .list_id | |
| 1069 | 추가: .as_ref() | |
| 1070 | 추가: .is_some_and(|id| id.format == Format::Gzip) | |
| 1071 | 추가: { | |
| 1072 | 추가: "다른 이름으로 저장" | |
| 1073 | 추가: } else { | |
| 1074 | 추가: "다른 폴더에 풀기" | |
| 1075 | 추가: }, | |
| 1076 | 추가: !uncertain || self.checked_destination, | |
| 1077 | 추가: )) | |
| 1031 | 1078 | } else if t |
| 1032 | 1079 | .as_ref() |
| 1033 | 1080 | .is_some_and(|t| t.error == Some(ErrorCode::SourceChanged)) |
| @@ -1054,7 +1101,9 @@ impl ArchiveApp { | ||
| 1054 | 1101 | if primary { |
| 1055 | 1102 | match action.map(|(label, _)| label) { |
| 1056 | 1103 | Some("폴더 열기") => folder = true, |
| 1057 | 삭제: Some("다른 폴더에 풀기") => choose = true, | |
| 1104 | 추가: Some("다른 폴더에 풀기" | "다른 이름으로 저장") => { | |
| 1105 | 추가: choose = true | |
| 1106 | 추가: } | |
| 1058 | 1107 | Some("압축파일 다시 열기") => reopen = true, |
| 1059 | 1108 | Some("다시 시도" | "다시 만들기") => retry = true, |
| 1060 | 1109 | _ => {} |
바이너리 파일이라 Diff를 표시하지 않아요.
파일 내려받기| @@ -310,6 +310,7 @@ mod screen { | ||
| 310 | 310 | } |
| 311 | 311 | include!("password_flows.rs"); |
| 312 | 312 | include!("selection_flows.rs"); |
| 313 | 추가: include!("native_dialog_flows.rs"); | |
| 313 | 314 | |
| 314 | 315 | fn archive_flow(name: &str, format: Format) { |
| 315 | 316 | let scratch = Scratch::new(); |
| @@ -0,0 +1,86 @@ | ||
| 1 | 추가: fn native_fixture(scratch: &Scratch, fixture: &str, name: &str) -> PathBuf { | |
| 2 | 추가: let target = scratch.path(name); | |
| 3 | 추가: fs::copy( | |
| 4 | 추가: Path::new(env!("CARGO_MANIFEST_DIR")) | |
| 5 | 추가: .join("../../tests/rust-app-real-worker/fixtures") | |
| 6 | 추가: .join(fixture), | |
| 7 | 추가: &target, | |
| 8 | 추가: ).unwrap(); | |
| 9 | 추가: target | |
| 10 | 추가: } | |
| 11 | 추가: | |
| 12 | 추가: #[test] | |
| 13 | 추가: fn raw_gzip_save_dialog_corrects_names_and_preserves_cancel_and_conflict_retry() { | |
| 14 | 추가: use zipelo_ui_memory_app::archive_dialog::Purpose; | |
| 15 | 추가: let mut names = vec![".gz", "report.GZ", "report.Gz", "report.gz"]; | |
| 16 | 추가: #[cfg(unix)] | |
| 17 | 추가: names.push("report:2026.gz"); | |
| 18 | 추가: for name in names { | |
| 19 | 추가: let scratch = Scratch::new(); | |
| 20 | 추가: let archive = native_fixture(&scratch, "sample.gz", name); | |
| 21 | 추가: let original = fs::read(&archive).unwrap(); | |
| 22 | 추가: let output = make_directory(&scratch.path("output")); | |
| 23 | 추가: let (factory, observed) = observed_factory(); | |
| 24 | 추가: let mut screen = Screen::new(factory); | |
| 25 | 추가: screen.open(&archive); | |
| 26 | 추가: assert_eq!(screen.app.model.list_id.as_ref().unwrap().format, Format::Gzip); | |
| 27 | 추가: screen.click("압축해제"); | |
| 28 | 추가: assert!(!screen.app.model.busy()); | |
| 29 | 추가: assert_eq!(observed.borrow().jobs.len(), 1); | |
| 30 | 추가: let request = screen.dialogs.0.borrow().requests.last().unwrap().clone(); | |
| 31 | 추가: assert_eq!(request.purpose, Purpose::SaveGzip); | |
| 32 | 추가: assert_eq!(request.directory, scratch.0); | |
| 33 | 추가: assert_eq!(request.file_name, if name == ".gz" || name.contains(':') { "압축 해제 파일" } else { "report" }); | |
| 34 | 추가: let existing = output.join("기존 파일.txt"); | |
| 35 | 추가: fs::write(&existing, b"preserve").unwrap(); | |
| 36 | 추가: screen.dialogs.0.borrow_mut().answers.push_back(Some(vec![existing.clone()])); | |
| 37 | 추가: screen.click("압축해제"); | |
| 38 | 추가: let deadline = Instant::now() + Duration::from_secs(10); | |
| 39 | 추가: while screen.app.model.busy() { | |
| 40 | 추가: screen.render(vec![]); | |
| 41 | 추가: assert!(Instant::now() < deadline); | |
| 42 | 추가: std::thread::sleep(Duration::from_millis(2)); | |
| 43 | 추가: } | |
| 44 | 추가: assert_eq!(screen.app.model.terminal.as_ref().unwrap().error, Some(ErrorCode::Conflict)); | |
| 45 | 추가: assert_eq!(fs::read(&existing).unwrap(), b"preserve"); | |
| 46 | 추가: screen.click("다른 이름으로 저장"); | |
| 47 | 추가: assert!(!screen.app.model.busy()); | |
| 48 | 추가: assert_eq!(observed.borrow().jobs.len(), 2); | |
| 49 | 추가: assert_eq!(screen.dialogs.0.borrow().requests.last().unwrap().purpose, Purpose::RetryGzip); | |
| 50 | 추가: let saved = output.join("사용자 이름.txt"); | |
| 51 | 추가: screen.dialogs.0.borrow_mut().answers.push_back(Some(vec![saved.clone()])); | |
| 52 | 추가: screen.click("다른 이름으로 저장"); | |
| 53 | 추가: screen.settle(); | |
| 54 | 추가: assert_eq!(fs::read(saved).unwrap(), b"Zipelo real worker flow\n"); | |
| 55 | 추가: assert_eq!(fs::read(existing).unwrap(), b"preserve"); | |
| 56 | 추가: assert_eq!(fs::read(&archive).unwrap(), original); | |
| 57 | 추가: assert!(matches!( | |
| 58 | 추가: observed.borrow().starts.last(), | |
| 59 | 추가: Some(Start::Extract { destination, gzip_output_name: Some(name), .. }) | |
| 60 | 추가: if destination == &output && name == "사용자 이름.txt" | |
| 61 | 추가: )); | |
| 62 | 추가: assert_reaped(&observed); | |
| 63 | 추가: } | |
| 64 | 추가: } | |
| 65 | 추가: | |
| 66 | 추가: #[test] | |
| 67 | 추가: fn mixed_case_zip_names_open_and_extract_through_native_dialog_responses() { | |
| 68 | 추가: use zipelo_ui_memory_app::archive_dialog::Purpose; | |
| 69 | 추가: for name in ["sample.ZIP", "sample.Zip", "sample.zIp"] { | |
| 70 | 추가: let scratch = Scratch::new(); | |
| 71 | 추가: let archive = native_fixture(&scratch, "sample.zip", name); | |
| 72 | 추가: let original = fs::read(&archive).unwrap(); | |
| 73 | 추가: let output = make_directory(&scratch.path("output")); | |
| 74 | 추가: let (factory, observed) = observed_factory(); | |
| 75 | 추가: let mut screen = Screen::new(factory); | |
| 76 | 추가: screen.dialogs.0.borrow_mut().answers.push_back(Some(vec![archive.clone()])); | |
| 77 | 추가: screen.click("열기"); | |
| 78 | 추가: screen.settle(); | |
| 79 | 추가: assert_eq!(screen.dialogs.0.borrow().requests[0].purpose, Purpose::Open); | |
| 80 | 추가: assert_eq!(screen.app.model.list_id.as_ref().unwrap().format, Format::Zip); | |
| 81 | 추가: screen.extract(&output); | |
| 82 | 추가: assert_eq!(fs::read(output.join("content.txt")).unwrap(), b"Zipelo real worker flow\n"); | |
| 83 | 추가: assert_eq!(fs::read(archive).unwrap(), original); | |
| 84 | 추가: assert_reaped(&observed); | |
| 85 | 추가: } | |
| 86 | 추가: } |
| @@ -0,0 +1,77 @@ | ||
| 1 | 추가: use std::{collections::BTreeSet, path::Path}; | |
| 2 | 추가: use zipelo_ui_memory_app::{ | |
| 3 | 추가: archive_dialog::archive_filters, | |
| 4 | 추가: archive_present::{gzip_output_name, valid_output_leaf}, | |
| 5 | 추가: }; | |
| 6 | 추가: | |
| 7 | 추가: #[test] | |
| 8 | 추가: fn archive_filter_contains_every_case_variant_and_all_files_option() { | |
| 9 | 추가: let filters = archive_filters(); | |
| 10 | 추가: assert_eq!(filters.len(), 2); | |
| 11 | 추가: assert_eq!(filters[0].0, "압축파일"); | |
| 12 | 추가: let expected = [ | |
| 13 | 추가: "zip", "ziP", "zIp", "zIP", "Zip", "ZiP", "ZIp", "ZIP", "7z", "7Z", "tar", "taR", "tAr", | |
| 14 | 추가: "tAR", "Tar", "TaR", "TAr", "TAR", "gz", "gZ", "Gz", "GZ", "tgz", "tgZ", "tGz", "tGZ", | |
| 15 | 추가: "Tgz", "TgZ", "TGz", "TGZ", | |
| 16 | 추가: ] | |
| 17 | 추가: .into_iter() | |
| 18 | 추가: .map(str::to_owned) | |
| 19 | 추가: .collect::<BTreeSet<_>>(); | |
| 20 | 추가: assert_eq!( | |
| 21 | 추가: filters[0].1.iter().cloned().collect::<BTreeSet<_>>(), | |
| 22 | 추가: expected | |
| 23 | 추가: ); | |
| 24 | 추가: assert_eq!(filters[0].1.len(), expected.len()); | |
| 25 | 추가: assert_eq!(filters[1], ("모든 파일", vec!["*".to_owned()])); | |
| 26 | 추가: } | |
| 27 | 추가: | |
| 28 | 추가: #[test] | |
| 29 | 추가: fn gzip_suggested_names_are_portable_and_preserve_valid_stems() { | |
| 30 | 추가: for name in [ | |
| 31 | 추가: ".gz", | |
| 32 | 추가: ".GZ", | |
| 33 | 추가: "report:2026.gz", | |
| 34 | 추가: "report?2026.gz", | |
| 35 | 추가: "CON.gz", | |
| 36 | 추가: "COM1.gz", | |
| 37 | 추가: "name..gz", | |
| 38 | 추가: "name .gz", | |
| 39 | 추가: ] { | |
| 40 | 추가: assert_eq!( | |
| 41 | 추가: gzip_output_name(Path::new(name)), | |
| 42 | 추가: "압축 해제 파일", | |
| 43 | 추가: "{name}" | |
| 44 | 추가: ); | |
| 45 | 추가: } | |
| 46 | 추가: for (name, expected) in [ | |
| 47 | 추가: ("report.gz", "report"), | |
| 48 | 추가: ("report.GZ", "report"), | |
| 49 | 추가: ("report.Gz", "report"), | |
| 50 | 추가: ("한글.gz", "한글"), | |
| 51 | 추가: ("input.archive", "input.archive"), | |
| 52 | 추가: ] { | |
| 53 | 추가: assert_eq!(gzip_output_name(Path::new(name)), expected); | |
| 54 | 추가: } | |
| 55 | 추가: for name in [ | |
| 56 | 추가: "", | |
| 57 | 추가: ".", | |
| 58 | 추가: "..", | |
| 59 | 추가: "../file", | |
| 60 | 추가: "dir/file", | |
| 61 | 추가: "dir\\file", | |
| 62 | 추가: "a:b", | |
| 63 | 추가: "a*", | |
| 64 | 추가: "a?", | |
| 65 | 추가: "a|b", | |
| 66 | 추가: "a<b", | |
| 67 | 추가: "a>b", | |
| 68 | 추가: "a\"b", | |
| 69 | 추가: "NUL.txt", | |
| 70 | 추가: "name.", | |
| 71 | 추가: "name ", | |
| 72 | 추가: "control\n", | |
| 73 | 추가: ] { | |
| 74 | 추가: assert!(!valid_output_leaf(name), "{name:?}"); | |
| 75 | 추가: } | |
| 76 | 추가: assert!(valid_output_leaf("사용자 이름.txt")); | |
| 77 | 추가: } |
| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | #[cfg(feature = "ui")] |
| 2 | 2 | mod dialogs; |
| 3 | 3 | mod fake; |
| 4 | 추가: #[cfg(feature = "ui")] | |
| 5 | 추가: mod native_dialogs; | |
| 4 | 6 | use fake::*; |
| 5 | 7 | use std::path::PathBuf; |
| 6 | 8 | use zipelo_ui_memory_app::archive_ui::*; |
| @@ -663,7 +665,11 @@ fn extract_button_sends_gzip_name_only_for_raw_gzip() { | ||
| 663 | 665 | .0 |
| 664 | 666 | .borrow_mut() |
| 665 | 667 | .answers |
| 666 | 삭제: .push_back(Some(vec![scratch.0.clone()])); | |
| 668 | 추가: .push_back(Some(vec![if format == Format::Gzip { | |
| 669 | 추가: scratch.0.join("압축 해제 파일") | |
| 670 | 추가: } else { | |
| 671 | 추가: scratch.0.clone() | |
| 672 | 추가: }])); | |
| 667 | 673 | app.set_dialogs(Box::new(dialogs)); |
| 668 | 674 | let texts = render(&mut app, vec![]); |
| 669 | 675 | let button = texts |
| @@ -327,3 +327,21 @@ fn excluding_a_child_after_folder_selection_does_not_restore_it_during_extractio | ||
| 327 | 327 | Some(Start::Extract { selection: Selection::EntryIds(ids), .. }) if ids == &vec![2] |
| 328 | 328 | )); |
| 329 | 329 | } |
| 330 | 추가: | |
| 331 | 추가: #[test] | |
| 332 | 추가: fn gzip_save_cancel_and_invalid_output_do_not_start_an_extraction() { | |
| 333 | 추가: let scratch = Folder::new(); | |
| 334 | 추가: let factory = FakeFactory::default(); | |
| 335 | 추가: factory.state.borrow_mut().list_format = Some(Format::Gzip); | |
| 336 | 추가: let mut app = loaded(&scratch, &factory); | |
| 337 | 추가: let dialogs = TestDialogs::default(); | |
| 338 | 추가: app.set_dialogs(Box::new(dialogs.clone())); | |
| 339 | 추가: let ctx = egui::Context::default(); | |
| 340 | 추가: policy_click(&ctx, &mut app, "압축해제"); | |
| 341 | 추가: assert_eq!(factory.state.borrow().starts.len(), 1); | |
| 342 | 추가: assert_eq!(dialogs.0.borrow().requests[0].purpose, Purpose::SaveGzip); | |
| 343 | 추가: dialogs.0.borrow_mut().answers.push_back(Some(vec![scratch.0.join("invalid:name")])); | |
| 344 | 추가: policy_click(&ctx, &mut app, "압축해제"); | |
| 345 | 추가: assert_eq!(factory.state.borrow().starts.len(), 1); | |
| 346 | 추가: assert!(!app.model.busy()); | |
| 347 | 추가: } |
| @@ -16,6 +16,8 @@ tests/rust-app-real-worker/selection_flows.rs는 전체, 파일, 폴더, 혼합, | ||
| 16 | 16 | |
| 17 | 17 | Enter는 초점이 있는 버튼만 활성화하며 암호 입력란 제출만 예외임. 완료 + Unconfirmed 안내는 자세히 보기에, Failed 내구성 경고와 실패 및 부분 추출의 Unconfirmed 안내는 본문에 표시함. 자동 풀 위치의 Unix 0700 생성, 렌더러 폴백과 계약 revision 2도 기존 회귀 시험을 유지함. |
| 18 | 18 | |
| 19 | 추가: 단일 파일 GZ는 운영체제 저장 창에서 출력 이름과 위치를 선택하며 TAR.GZ는 폴더 선택을 유지함. 빈 이름, 금지 문자와 예약 이름은 안전한 기본 이름으로 제안하고 반환된 이름도 검증함. native_dialog_flows.rs는 GZ의 취소, 충돌 뒤 이름 변경, 원본 보존과 대소문자 ZIP 열기를 실제 작업자로 확인함. native_dialogs.rs는 확장자 대소문자 조합 30개와 모든 파일 선택지 및 GZ 기본 이름을 검증함. | |
| 20 | 추가: | |
| 19 | 21 | ## 화면 재현 |
| 20 | 22 | |
| 21 | 23 | Xvfb, xdotool, ImageMagick import와 시스템 CJK 글꼴이 필요함. 촬영 실행 파일은 실제 eframe 컴포넌트에 합성 목록을 전달하며 압축파일을 읽거나 결과물을 저장하지 않음. |