team-ljyzipelo

공개
680줄26 KB
1#![cfg(debug_assertions)]
2
3use eframe::egui;
4use std::{collections::BTreeSet, ffi::OsString};
5use zipelo_ui_memory_app::archive_screen::scenarios::{self, Launch, SCENARIOS};
6
7#[test]
8fn every_name_round_trips_and_listing_has_no_duplicates() {
9 let names: BTreeSet<_> = SCENARIOS.iter().map(|s| s.name).collect();
10 assert_eq!(names.len(), SCENARIOS.len());
11 for scenario in SCENARIOS {
12 assert_eq!(scenarios::parse(scenario.name), Ok(*scenario));
13 assert!(scenarios::listing().contains(scenario.description));
14 assert!(
15 include_str!("../../docs/ui-scenario-guide.md")
16 .contains(&format!("- {}:", scenario.name))
17 );
18 assert_eq!(
19 scenarios::launch(vec!["--ui-scenario".into(), scenario.name.into()]),
20 Ok(Launch::Scenario(*scenario)),
21 );
22 }
23 assert_eq!(
24 scenarios::launch(vec!["--list-ui-scenarios".into()]),
25 Ok(Launch::List)
26 );
27}
28
29#[test]
30fn unknown_missing_and_conflicting_arguments_are_rejected_with_catalog() {
31 for args in [
32 vec!["--ui-scenario", "missing"],
33 vec!["--ui-scenario"],
34 vec!["--ui-scenario", "archive", "file.zip"],
35 vec!["--list-ui-scenarios", "file.zip"],
36 vec!["--ui-fixture", "--ui-scenario", "archive"],
37 ] {
38 let error = scenarios::launch(args.into_iter().map(OsString::from).collect()).unwrap_err();
39 for scenario in SCENARIOS {
40 assert!(error.contains(scenario.name));
41 }
42 }
43 let original = vec![OsString::from("압축 자료.zip")];
44 assert_eq!(
45 scenarios::launch(original.clone()),
46 Ok(Launch::Normal(original))
47 );
48}
49
50fn text(shapes: &[egui::epaint::ClippedShape]) -> String {
51 fn collect(shape: &egui::Shape, result: &mut String) {
52 match shape {
53 egui::Shape::Text(t) => {
54 result.push_str(t.galley.text());
55 result.push('\n');
56 }
57 egui::Shape::Vec(shapes) => {
58 for shape in shapes {
59 collect(shape, result);
60 }
61 }
62 _ => {}
63 }
64 }
65 let mut result = String::new();
66 for shape in shapes {
67 collect(&shape.shape, &mut result);
68 }
69 result
70}
71
72#[test]
73fn every_listed_scenario_draws_and_keeps_its_expected_screen() {
74 for scenario in SCENARIOS {
75 for size in [egui::vec2(1060.0, 720.0), egui::vec2(760.0, 540.0)] {
76 let ctx = egui::Context::default();
77 let mut app = scenario.build();
78 let mut labels = String::new();
79 for _ in 0..3 {
80 let mut output = ctx.run_ui(
81 egui::RawInput {
82 screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, size)),
83 ..Default::default()
84 },
85 |ui| scenario.show(&mut app, ui),
86 );
87 assert!(!output.shapes.is_empty(), "{}", scenario.name);
88 labels = text(&output.shapes);
89 output.textures_delta.clear();
90 }
91 assert!(
92 app.model.error.is_none(),
93 "{}: {:?}",
94 scenario.name,
95 app.model.error
96 );
97 assert!(app.model.input_error.is_none(), "{}", scenario.name);
98 if scenario.name.starts_with("recovery-") {
99 let expected = match scenario.name {
100 "recovery-complete" => "복구본 저장 완료",
101 "recovery-partial" => "일부 항목만 복구함",
102 "recovery-unknown" => "전체 목록을 알 수 없어",
103 "recovery-impossible" => "복구 가능한 항목 없음",
104 "recovery-save-error" => "복구본 저장을 완료하지 못했습니다",
105 "recovery-cancelled" => "복구를 취소했습니다",
106 "recovery-resource" => "이 작업 허용",
107 _ => "ZIP 복구 중",
108 };
109 assert!(labels.contains(expected), "{}: {labels}", scenario.name);
110 assert_eq!(
111 labels.contains("복구본 열기"),
112 matches!(
113 scenario.name,
114 "recovery-complete" | "recovery-partial" | "recovery-unknown"
115 )
116 );
117 assert!(!labels.contains("100%"));
118 }
119 if scenario.name == "split-archive" {
120 assert!(app.model.list_id.as_ref().unwrap().is_split());
121 assert!(!app.model.can_preview());
122 }
123 let expected = match scenario.name {
124 "split-archive" => "읽어주세요.txt",
125 "split-first-volume" => "첫 조각 여행.7z.001을 선택해 다시 여세요.",
126 "split-missing-volume" => "여행.7z.003 조각이 없습니다",
127 "split-incomplete" => "분할 묶음이 불완전하거나 손상됐습니다",
128 "split-unsupported" => "분할 ZIP과 RAR",
129 "split-source-changed" => "원본 파일이 바뀌었습니다",
130 "preview-implicit-folder" => "자료",
131 "preview-catalog-approval" | "preview-catalog-bytes-approval" => {
132 "큰 작업을 허용할까요?"
133 }
134 "preview-loading" => "미리보기를 불러오는 중입니다",
135 "preview-text" => "여행 준비 목록",
136 "preview-image" => "미리보기",
137 "preview-empty" => "빈 텍스트 파일입니다",
138 "preview-limit" => "미리보기 크기 또는 처리 한도를 초과했습니다",
139 "preview-damaged" => "파일이 손상됐거나 UTF-8 텍스트가 아닙니다",
140 "preview-unsupported" => "이 파일 형식은 미리보기를 지원하지 않습니다",
141 "resource-approval" => "큰 작업을 허용할까요?",
142 "resource-ratio" => "압축률이 매우 높습니다",
143 "resource-retry" => "한도를 늘려 다시 시도",
144 "resource-partial" => "저장 위치를 확인하세요",
145 "uninstall-windows" => "제거 전에 다른 앱을 선택하세요",
146 "uninstall-settings-error" => "Windows 설정을 열지 못했습니다",
147 "uninstall-ubuntu-missing" => "이전 앱을 복원할 수 없습니다",
148 "uninstall-ubuntu-unknown-user" => "사용자 기본 앱 설정은 변경하지 않습니다",
149 "conflict-choice" | "conflict-apply" | "gzip-conflict-choice" => {
150 "나머지 파일에도 같게 적용"
151 }
152 "extract-skipped" => "모든 파일을 건너뛰었습니다",
153 "extract-rename-failed" => "아무 파일도 풀지 않았습니다",
154 "extract-renamed" => "이름 바꿔 저장: 읽어주세요 (1).txt",
155 "empty" => "TAR.BZ2, TAR.XZ",
156 "tar-bz2" | "tar-xz" => "읽어주세요.txt",
157 "folder-empty" => "이 폴더는 비어 있습니다",
158 "dialog-error" => "파일 선택 창을 열 수 없습니다",
159 "extract-partial" => "일부 파일만 풀렸습니다",
160 "extract-uncertain" => "저장이 끝났는지 확인하지 못했습니다",
161 "extract-unsynced" => "파일을 디스크에 완전히 저장했는지 확인하지 못했습니다",
162 "source-changed" => "압축파일 다시 열기",
163 "gzip-conflict" => "다른 이름으로 저장",
164 "create-sevenzip" => "7z는 암호를 지원하지 않습니다",
165 "create-sevenzip-progress" => "파일을 저장하는 중",
166 "create-sevenzip-complete" => "7z 파일을 만들었습니다",
167 "create-sevenzip-error" => "7z 파일을 만들지 못했습니다",
168 "create-sevenzip-cancelled" => "작업을 취소했습니다",
169 "create-sevenzip-resource" => "큰 작업을 허용할까요?",
170 "create-error" => "ZIP 파일을 만들지 못했습니다",
171 "password-create" => "암호 확인",
172 "folder" => "바다.jpg",
173 "search-empty" => "일치하는 항목이 없습니다",
174 "password" | "password-retry" => "암호",
175 "extract-complete" => "압축을 풀었습니다",
176 "extract-cancelled" => "작업을 취소했습니다",
177 "create-complete" => "ZIP 파일을 만들었습니다",
178 "create" | "create-encrypted" => "암호로 보호하기",
179 "unsupported" | "damaged" => "압축파일을 열지 못했습니다",
180 "conflict" => "압축을 풀지 못했습니다",
181 "close-confirm" => "닫",
182 _ => "읽어주세요.txt",
183 };
184 assert!(labels.contains(expected), "{}: {labels}", scenario.name);
185 if scenario.name == "extract-rename-failed" {
186 assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
187 assert!(!labels.contains("이름 바꿔 저장:"), "{labels}");
188 }
189 if matches!(scenario.name, "tar-bz2" | "tar-xz") {
190 assert!(app.model.entries.iter().all(|entry| !entry.encrypted));
191 assert_eq!(
192 app.model.list_id.as_ref().unwrap().format,
193 zipelo_ui_memory_app::archive_ui::Format::Tar
194 );
195 }
196 if scenario.name == "many-items" {
197 assert_eq!(app.model.entries.len(), 505);
198 }
199 if matches!(scenario.name, "selection" | "marquee") {
200 assert_eq!(app.model.selected.len(), 4);
201 assert!(labels.contains("선택 2개"));
202 }
203 if scenario.name == "password-retry" {
204 assert_eq!(app.model.challenge.unwrap().1, 2);
205 }
206 }
207 }
208}
209
210#[test]
211fn command_line_catalog_and_errors_work_without_a_display() {
212 let run = |args: &[&str]| {
213 std::process::Command::new(env!("CARGO_BIN_EXE_zipelo-ui-memory-app"))
214 .args(args)
215 .env_remove("DISPLAY")
216 .env_remove("WAYLAND_DISPLAY")
217 .output()
218 .unwrap()
219 };
220 let listed = run(&["--list-ui-scenarios"]);
221 assert!(listed.status.success());
222 assert_eq!(
223 String::from_utf8(listed.stdout).unwrap(),
224 scenarios::listing()
225 );
226 for args in [vec!["--ui-scenario", "unknown"], vec!["--ui-scenario"]] {
227 let failed = run(&args);
228 assert!(!failed.status.success());
229 let stderr = String::from_utf8_lossy(&failed.stderr);
230 for scenario in SCENARIOS {
231 assert!(stderr.contains(scenario.name));
232 }
233 }
234}
235
236#[test]
237fn preview_ignores_password_submission() {
238 let ctx = egui::Context::default();
239 let mut preview = scenarios::Preview::new(scenarios::parse("password").unwrap().build(), &ctx);
240 for _ in 0..3 {
241 let mut output = ctx.run_ui(
242 egui::RawInput {
243 screen_rect: Some(egui::Rect::from_min_size(
244 egui::Pos2::ZERO,
245 egui::vec2(1060.0, 720.0),
246 )),
247 events: vec![
248 egui::Event::Text("화면 검토".into()),
249 egui::Event::Key {
250 key: egui::Key::Enter,
251 physical_key: None,
252 pressed: true,
253 repeat: false,
254 modifiers: egui::Modifiers::NONE,
255 },
256 ],
257 ..Default::default()
258 },
259 |ui| preview.0.show(ui),
260 );
261 output.textures_delta.clear();
262 }
263 assert_eq!(preview.0.model.challenge, Some((17, 1, false)));
264 assert!(preview.0.model.busy());
265}
266
267#[test]
268fn uninstall_previews_match_packaged_notices_and_do_not_start_jobs() {
269 let installer = include_str!("../../packaging/windows/rust/installer.nsi");
270 let prerm = include_str!("../../packaging/ubuntu/rust/prerm");
271 let helper = include_str!("../../packaging/ubuntu/rust/default-apps");
272 for (name, source, expected) in [
273 (
274 "uninstall-windows",
275 installer,
276 "직접 고른 기본 앱은 자동으로 바꾸지 않습니다.",
277 ),
278 (
279 "uninstall-settings-error",
280 installer,
281 "Windows 설정을 열지 못했습니다.",
282 ),
283 (
284 "uninstall-ubuntu-missing",
285 helper,
286 "이전 앱을 복원할 수 없습니다:",
287 ),
288 (
289 "uninstall-ubuntu-unknown-user",
290 prerm,
291 "제거를 요청한 사용자를 확인할 수 없어 사용자 기본 앱 설정은 변경하지 않습니다.",
292 ),
293 ] {
294 assert!(source.contains(expected));
295 let scenario = scenarios::parse(name).unwrap();
296 let ctx = egui::Context::default();
297 let mut preview = scenarios::Preview::new(scenario.build(), &ctx).with_scenario(scenario);
298 let mut output = ctx.run_ui(
299 egui::RawInput {
300 screen_rect: Some(egui::Rect::from_min_size(
301 egui::Pos2::ZERO,
302 egui::vec2(760.0, 540.0),
303 )),
304 events: vec![egui::Event::Key {
305 key: egui::Key::Enter,
306 physical_key: None,
307 pressed: true,
308 repeat: false,
309 modifiers: egui::Modifiers::NONE,
310 }],
311 ..Default::default()
312 },
313 |ui| preview.show(ui),
314 );
315 assert!(text(&output.shapes).contains(expected), "{name}");
316 assert!(!preview.0.model.busy());
317 assert!(preview.0.model.archive.is_none());
318 assert!(output.platform_output.commands.is_empty());
319 output.textures_delta.clear();
320 }
321}
322
323fn result_labels(
324 app: &mut zipelo_ui_memory_app::archive_screen::ArchiveApp,
325 size: egui::Vec2,
326) -> String {
327 let ctx = egui::Context::default();
328 let mut labels = String::new();
329 for _ in 0..3 {
330 let mut output = ctx.run_ui(
331 egui::RawInput {
332 screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, size)),
333 ..Default::default()
334 },
335 |ui| app.show(ui),
336 );
337 labels = text(&output.shapes);
338 output.textures_delta.clear();
339 }
340 labels
341}
342
343#[test]
344fn rename_without_created_output_never_claims_saved_name() {
345 use zipelo_ui_memory_app::archive_ui::*;
346 for size in [egui::vec2(1060.0, 720.0), egui::vec2(760.0, 540.0)] {
347 for disposition in [
348 None,
349 Some(Disposition::PartialRetained),
350 Some(Disposition::Removed),
351 Some(Disposition::CommitUncertain),
352 ] {
353 let mut app = scenarios::parse("extract-renamed").unwrap().build();
354 app.model.outputs = disposition
355 .into_iter()
356 .map(|d| ("읽어주세요 (1).txt".into(), d))
357 .collect();
358 app.model.terminal = Some(Terminal {
359 outcome: Outcome::Failed,
360 error: Some(ErrorCode::Io),
361 publication: if disposition.is_none() {
362 Publication::None
363 } else {
364 Publication::Uncertain
365 },
366 created_count: 0,
367 retained_partial_count: 0,
368 durability: Durability::NotApplicable,
369 cleanup: Cleanup::Complete,
370 });
371 let labels = result_labels(&mut app, size);
372 assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
373 if disposition.is_none() {
374 assert!(labels.contains("아무 파일도 풀지 않았습니다"), "{labels}");
375 }
376 assert!(
377 !labels.contains("이름 바꿔 저장: 읽어주세요 (1).txt"),
378 "{labels}"
379 );
380 }
381 }
382}
383
384#[test]
385fn rename_saved_before_later_failure_remains_reported() {
386 use zipelo_ui_memory_app::archive_ui::*;
387 for size in [egui::vec2(1060.0, 720.0), egui::vec2(760.0, 540.0)] {
388 let mut app = scenarios::parse("extract-renamed").unwrap().build();
389 app.model.resolutions.push(Resolution {
390 entry_id: 2,
391 relative_name: "여행 일정 (1).pdf".into(),
392 choice: ConflictChoice::Rename,
393 });
394 app.model.terminal.as_mut().unwrap().outcome = Outcome::Failed;
395 app.model.terminal.as_mut().unwrap().error = Some(ErrorCode::Io);
396 app.model.terminal.as_mut().unwrap().publication = Publication::Partial;
397 let labels = result_labels(&mut app, size);
398 assert!(
399 labels.contains("이름 바꿔 저장: 읽어주세요 (1).txt"),
400 "{labels}"
401 );
402 assert!(
403 !labels.contains("이름 바꿔 저장: 여행 일정 (1).pdf"),
404 "{labels}"
405 );
406 assert!(labels.contains("파일을 읽거나 쓰지 못했습니다"), "{labels}");
407 }
408}
409
410fn resource_frame(
411 app: &mut zipelo_ui_memory_app::archive_screen::ArchiveApp,
412 ctx: &egui::Context,
413 events: Vec<egui::Event>,
414) -> Vec<egui::epaint::ClippedShape> {
415 let mut out = ctx.run_ui(
416 egui::RawInput {
417 screen_rect: Some(egui::Rect::from_min_size(
418 egui::Pos2::ZERO,
419 egui::vec2(760.0, 540.0),
420 )),
421 events,
422 ..Default::default()
423 },
424 |ui| app.show(ui),
425 );
426 out.textures_delta.clear();
427 out.shapes
428}
429fn find_resource_action(shapes: &[egui::epaint::ClippedShape], label: &str) -> egui::Pos2 {
430 fn find(s: &egui::Shape, label: &str) -> Option<egui::Pos2> {
431 match s {
432 egui::Shape::Text(t) if t.galley.text() == label => {
433 Some(t.pos + t.galley.rect.size() / 2.0)
434 }
435 egui::Shape::Vec(shapes) => shapes.iter().find_map(|s| find(s, label)),
436 _ => None,
437 }
438 }
439 shapes.iter().find_map(|s| find(&s.shape, label)).unwrap()
440}
441#[test]
442fn resource_dialog_requires_explicit_click_and_escape_cancels() {
443 for allow in [false, true] {
444 let ctx = egui::Context::default();
445 let mut app = scenarios::parse("resource-ratio").unwrap().build();
446 let mut shapes = Vec::new();
447 for _ in 0..3 {
448 shapes = resource_frame(&mut app, &ctx, vec![]);
449 }
450 assert!(text(&shapes).contains("미확인"));
451 resource_frame(
452 &mut app,
453 &ctx,
454 vec![egui::Event::Key {
455 key: egui::Key::Enter,
456 physical_key: None,
457 pressed: true,
458 repeat: false,
459 modifiers: Default::default(),
460 }],
461 );
462 assert!(app.model.resource.is_some());
463 if allow {
464 let point = find_resource_action(&shapes, "이 작업 허용");
465 resource_frame(
466 &mut app,
467 &ctx,
468 vec![
469 egui::Event::PointerMoved(point),
470 egui::Event::PointerButton {
471 pos: point,
472 button: egui::PointerButton::Primary,
473 pressed: true,
474 modifiers: Default::default(),
475 },
476 ],
477 );
478 resource_frame(
479 &mut app,
480 &ctx,
481 vec![egui::Event::PointerButton {
482 pos: point,
483 button: egui::PointerButton::Primary,
484 pressed: false,
485 modifiers: Default::default(),
486 }],
487 );
488 assert!(!app.model.cancellation_requested());
489 } else {
490 resource_frame(
491 &mut app,
492 &ctx,
493 vec![egui::Event::Key {
494 key: egui::Key::Escape,
495 physical_key: None,
496 pressed: true,
497 repeat: false,
498 modifiers: Default::default(),
499 }],
500 );
501 assert!(app.model.cancellation_requested());
502 }
503 assert!(app.model.resource.is_none());
504 }
505}
506#[test]
507fn partial_limit_result_never_offers_expanded_retry() {
508 let ctx = egui::Context::default();
509 let mut app = scenarios::parse("resource-partial").unwrap().build();
510 let mut shapes = Vec::new();
511 for _ in 0..3 {
512 shapes = resource_frame(&mut app, &ctx, vec![]);
513 }
514 assert!(!text(&shapes).contains("한도를 늘려 다시 시도"));
515 assert!(text(&shapes).contains("풀린 자료"));
516}
517
518#[test]
519fn preview_escape_discards_content_and_returns_to_list_without_changing_selection() {
520 for name in ["preview-text", "preview-image", "preview-loading"] {
521 let ctx = egui::Context::default();
522 let mut app = scenarios::parse(name).unwrap().build();
523 let selected = app.model.selected.clone();
524 for _ in 0..3 {
525 resource_frame(&mut app, &ctx, vec![]);
526 }
527 assert!(text(&resource_frame(&mut app, &ctx, vec![])).contains("미리보기"));
528 resource_frame(
529 &mut app,
530 &ctx,
531 vec![egui::Event::Key {
532 key: egui::Key::Escape,
533 physical_key: None,
534 pressed: true,
535 repeat: false,
536 modifiers: Default::default(),
537 }],
538 );
539 for _ in 0..3 {
540 resource_frame(&mut app, &ctx, vec![]);
541 }
542 assert!(app.model.preview.is_none());
543 assert_eq!(app.model.selected, selected);
544 if name == "preview-loading" {
545 assert!(app.model.cancellation_requested());
546 } else {
547 assert_eq!(
548 ctx.memory(|m| m.focused()),
549 Some(egui::Id::unique("archive-list"))
550 );
551 }
552 }
553}
554
555#[test]
556fn preview_image_respects_renderer_texture_limit() {
557 let ctx = egui::Context::default();
558 let mut app = scenarios::parse("preview-image").unwrap().build();
559 app.model.preview = Some(zipelo_ui_memory_app::archive_ui::Preview {
560 info: zipelo_ui_memory_app::archive_ui::PreviewInfo {
561 entry_id: 1,
562 format: zipelo_ui_memory_app::archive_ui::PreviewFormat::Rgba8,
563 width: 2048,
564 height: 1,
565 total_bytes: 8192,
566 },
567 data: vec![255; 8192],
568 });
569 let mut image_seen = false;
570 for _ in 0..3 {
571 let mut result = ctx.run_ui(
572 egui::RawInput {
573 max_texture_side: Some(1024),
574 screen_rect: Some(egui::Rect::from_min_size(
575 egui::Pos2::ZERO,
576 egui::vec2(760.0, 540.0),
577 )),
578 ..Default::default()
579 },
580 |ui| app.show(ui),
581 );
582 for (id, delta) in &result.textures_delta.set {
583 if *id == egui::TextureId::Managed(0) {
584 continue;
585 }
586 for image in delta {
587 assert!(image.image.size().iter().all(|n| *n <= 1024));
588 }
589 image_seen = true;
590 }
591 result.textures_delta.clear();
592 }
593 assert!(image_seen);
594}
595
596#[test]
597fn split_errors_use_main_modal_without_native_child() {
598 for name in [
599 "split-first-volume",
600 "split-missing-volume",
601 "split-incomplete",
602 "split-unsupported",
603 ] {
604 let scenario = scenarios::parse(name).unwrap();
605 let mut app = scenario.build();
606 let ctx = egui::Context::default();
607 ctx.set_embed_viewports(false);
608 let mut labels = String::new();
609 for _ in 0..3 {
610 let mut output = ctx.run_ui(
611 egui::RawInput {
612 screen_rect: Some(egui::Rect::from_min_size(
613 egui::Pos2::ZERO,
614 egui::vec2(1060.0, 720.0),
615 )),
616 ..Default::default()
617 },
618 |ui| scenario.show(&mut app, ui),
619 );
620 labels = text(&output.shapes);
621 output.textures_delta.clear();
622 assert!(
623 output
624 .viewport_output
625 .keys()
626 .all(|id| *id == egui::ViewportId::ROOT),
627 "{name}"
628 );
629 }
630 assert!(labels.contains("작업 결과"), "{name}: {labels}");
631 }
632}
633
634#[test]
635fn excluded_split_errors_show_support_guidance_in_main_modal() {
636 use zipelo_ui_memory_app::archive_ui::ErrorCode;
637
638 for code in [ErrorCode::UnsupportedFeature, ErrorCode::UnsupportedFormat] {
639 for archive in ["sample.zip.001", "sample.z01", "sample.rar", "sample.7z"] {
640 let scenario = scenarios::parse("split-unsupported").unwrap();
641 let mut app = scenario.build();
642 let ctx = egui::Context::default();
643 ctx.set_embed_viewports(false);
644 let input = || egui::RawInput {
645 screen_rect: Some(egui::Rect::from_min_size(
646 egui::Pos2::ZERO,
647 egui::vec2(1060.0, 720.0),
648 )),
649 ..Default::default()
650 };
651 for _ in 0..3 {
652 let mut output = ctx.run_ui(input(), |ui| scenario.show(&mut app, ui));
653 output.textures_delta.clear();
654 }
655 assert_eq!(
656 app.model.terminal.as_ref().unwrap().error,
657 Some(ErrorCode::UnsupportedFeature)
658 );
659 app.model.terminal.as_mut().unwrap().error = Some(code);
660 app.model.archive = Some(archive.into());
661 let mut output = ctx.run_ui(input(), |ui| scenario.show(&mut app, ui));
662 let labels = text(&output.shapes);
663 output.textures_delta.clear();
664 if archive == "sample.7z" {
665 assert!(!labels.contains("분할 ZIP과 RAR"));
666 } else {
667 assert!(
668 labels.contains("분할 ZIP과 RAR"),
669 "{code:?} {archive}: {labels}"
670 );
671 assert!(
672 output
673 .viewport_output
674 .keys()
675 .all(|id| *id == egui::ViewportId::ROOT)
676 );
677 }
678 }
679 }
680}