| | @@ -29,6 +29,7 @@ fn partial_extraction_requires_matching_file_reports() { |
| 29 | 29 | Some(&t), |
| 30 | 30 | true, |
| 31 | 31 | Some(&targets()), |
| 32 | +추가: &BTreeSet::new(), |
| 32 | 33 | &[("one.txt".into(), Disposition::Created)] |
| 33 | 34 | ), |
| 34 | 35 | vec![PARTIAL] |
| | @@ -45,6 +46,7 @@ fn all_saved_with_temporary_leftover_is_not_partial_extraction() { |
| 45 | 46 | Some(&t), |
| 46 | 47 | true, |
| 47 | 48 | Some(&files), |
| 49 | +추가: &BTreeSet::new(), |
| 48 | 50 | &[ |
| 49 | 51 | ("one.txt".into(), Disposition::Created), |
| 50 | 52 | ("temp".into(), Disposition::PartialRetained) |
| | @@ -62,8 +64,14 @@ fn leftover_without_file_reports_and_commit_uncertainty_are_unknown() { |
| 62 | 64 | vec![("temp".into(), Disposition::PartialRetained)], |
| 63 | 65 | vec![("one.txt".into(), Disposition::CommitUncertain)], |
| 64 | 66 | ] { |
| 65 | | -삭제: assert!(warnings(Some(&t), true, Some(&targets()), &outputs).contains(&UNCERTAIN)); |
| 66 | | -삭제: assert!(!warnings(Some(&t), true, Some(&targets()), &outputs).contains(&PARTIAL)); |
| 67 | +추가: assert!( |
| 68 | +추가: warnings(Some(&t), true, Some(&targets()), &BTreeSet::new(), &outputs) |
| 69 | +추가: .contains(&UNCERTAIN) |
| 70 | +추가: ); |
| 71 | +추가: assert!( |
| 72 | +추가: !warnings(Some(&t), true, Some(&targets()), &BTreeSet::new(), &outputs) |
| 73 | +추가: .contains(&PARTIAL) |
| 74 | +추가: ); |
| 67 | 75 | } |
| 68 | 76 | } |
| 69 | 77 | #[test] |
| | @@ -72,7 +80,7 @@ fn synchronization_and_cleanup_warnings_are_both_visible() { |
| 72 | 80 | t.created_count = 0; |
| 73 | 81 | t.durability = Durability::Unconfirmed; |
| 74 | 82 | t.cleanup = Cleanup::Failed; |
| 75 | | -삭제: let result = warnings(Some(&t), true, Some(&targets()), &[]); |
| 83 | +추가: let result = warnings(Some(&t), true, Some(&targets()), &BTreeSet::new(), &[]); |
| 76 | 84 | assert!(result.contains(&SYNC_WARNING)); |
| 77 | 85 | assert!(result.contains(&CLEANUP_WARNING)); |
| 78 | 86 | } |
| | @@ -86,7 +94,9 @@ fn missing_terminal_exit_or_contradictory_reports_never_claim_unsaved() { |
| 86 | 94 | assert!(!definitely_unsaved(Some(&t), false, &[])); |
| 87 | 95 | let reports = [("one.txt".into(), Disposition::Created)]; |
| 88 | 96 | assert!(!definitely_unsaved(Some(&t), true, &reports)); |
| 89 | | -삭제: assert!(warnings(Some(&t), true, Some(&targets()), &reports).contains(&UNCERTAIN)); |
| 97 | +추가: assert!( |
| 98 | +추가: warnings(Some(&t), true, Some(&targets()), &BTreeSet::new(), &reports).contains(&UNCERTAIN) |
| 99 | +추가: ); |
| 90 | 100 | } |
| 91 | 101 | #[test] |
| 92 | 102 | fn unsafe_path_and_conflict_preserve_result_classification() { |
| | @@ -98,12 +108,15 @@ fn unsafe_path_and_conflict_preserve_result_classification() { |
| 98 | 108 | Some(&t), |
| 99 | 109 | true, |
| 100 | 110 | Some(&targets()), |
| 111 | +추가: &BTreeSet::new(), |
| 101 | 112 | &[("one.txt".into(), Disposition::Created)] |
| 102 | 113 | ), |
| 103 | 114 | vec![PARTIAL] |
| 104 | 115 | ); |
| 105 | 116 | t.publication = Publication::Uncertain; |
| 106 | | -삭제: assert!(warnings(Some(&t), true, Some(&targets()), &[]).contains(&UNCERTAIN)); |
| 117 | +추가: assert!( |
| 118 | +추가: warnings(Some(&t), true, Some(&targets()), &BTreeSet::new(), &[]).contains(&UNCERTAIN) |
| 119 | +추가: ); |
| 107 | 120 | t.publication = Publication::None; |
| 108 | 121 | t.created_count = 0; |
| 109 | 122 | assert!(definitely_unsaved(Some(&t), true, &[])); |
| | @@ -167,6 +180,114 @@ fn folder_selection_expands_only_matching_descendants() { |
| 167 | 180 | Some(["docs/one.txt".into()].into_iter().collect()) |
| 168 | 181 | ); |
| 169 | 182 | } |
| 183 | +추가: |
| 184 | +추가: #[test] |
| 185 | +추가: fn directory_reports_allow_empty_and_mixed_archives_without_hiding_unknown_outputs() { |
| 186 | +추가: let directories = ["parent".into(), "parent/empty".into()] |
| 187 | +추가: .into_iter() |
| 188 | +추가: .collect(); |
| 189 | +추가: let empty = BTreeSet::new(); |
| 190 | +추가: let mut t = terminal(); |
| 191 | +추가: t.outcome = Outcome::Completed; |
| 192 | +추가: t.error = None; |
| 193 | +추가: t.publication = Publication::Complete; |
| 194 | +추가: t.created_count = 2; |
| 195 | +추가: let reports = [ |
| 196 | +추가: ("parent".into(), Disposition::Created), |
| 197 | +추가: ("parent/empty".into(), Disposition::Created), |
| 198 | +추가: ]; |
| 199 | +추가: assert!(warnings(Some(&t), true, Some(&empty), &directories, &reports).is_empty()); |
| 200 | +추가: t.created_count = 0; |
| 201 | +추가: assert!(warnings(Some(&t), true, Some(&empty), &directories, &[]).is_empty()); |
| 202 | +추가: let files = ["parent/file.txt".into()].into_iter().collect(); |
| 203 | +추가: t.created_count = 2; |
| 204 | +추가: let reports = [ |
| 205 | +추가: ("parent".into(), Disposition::Created), |
| 206 | +추가: ("parent/file.txt".into(), Disposition::Created), |
| 207 | +추가: ]; |
| 208 | +추가: assert!(warnings(Some(&t), true, Some(&files), &directories, &reports).is_empty()); |
| 209 | +추가: t.created_count = 1; |
| 210 | +추가: assert!( |
| 211 | +추가: warnings( |
| 212 | +추가: Some(&t), |
| 213 | +추가: true, |
| 214 | +추가: Some(&files), |
| 215 | +추가: &directories, |
| 216 | +추가: &[("parent".into(), Disposition::Created)] |
| 217 | +추가: ) |
| 218 | +추가: .contains(&UNCERTAIN) |
| 219 | +추가: ); |
| 220 | +추가: assert!( |
| 221 | +추가: warnings( |
| 222 | +추가: Some(&t), |
| 223 | +추가: true, |
| 224 | +추가: Some(&empty), |
| 225 | +추가: &directories, |
| 226 | +추가: &[("unknown".into(), Disposition::Created)] |
| 227 | +추가: ) |
| 228 | +추가: .contains(&UNCERTAIN) |
| 229 | +추가: ); |
| 230 | +추가: t.publication = Publication::Uncertain; |
| 231 | +추가: assert!( |
| 232 | +추가: warnings( |
| 233 | +추가: Some(&t), |
| 234 | +추가: true, |
| 235 | +추가: Some(&empty), |
| 236 | +추가: &directories, |
| 237 | +추가: &[("parent".into(), Disposition::CommitUncertain)] |
| 238 | +추가: ) |
| 239 | +추가: .contains(&UNCERTAIN) |
| 240 | +추가: ); |
| 241 | +추가: } |
| 242 | +추가: |
| 243 | +추가: #[test] |
| 244 | +추가: fn directory_targets_include_selected_members_and_implicit_parents() { |
| 245 | +추가: let entries = [ |
| 246 | +추가: Entry { |
| 247 | +추가: id: 0, |
| 248 | +추가: name: "top".into(), |
| 249 | +추가: kind: Kind::Directory, |
| 250 | +추가: bytes: None, |
| 251 | +추가: packed: None, |
| 252 | +추가: encrypted: false, |
| 253 | +추가: }, |
| 254 | +추가: Entry { |
| 255 | +추가: id: 1, |
| 256 | +추가: name: "top/empty".into(), |
| 257 | +추가: kind: Kind::Directory, |
| 258 | +추가: bytes: None, |
| 259 | +추가: packed: None, |
| 260 | +추가: encrypted: false, |
| 261 | +추가: }, |
| 262 | +추가: Entry { |
| 263 | +추가: id: 2, |
| 264 | +추가: name: "top/nested/file.txt".into(), |
| 265 | +추가: kind: Kind::File, |
| 266 | +추가: bytes: None, |
| 267 | +추가: packed: None, |
| 268 | +추가: encrypted: false, |
| 269 | +추가: }, |
| 270 | +추가: Entry { |
| 271 | +추가: id: 3, |
| 272 | +추가: name: "other/empty".into(), |
| 273 | +추가: kind: Kind::Directory, |
| 274 | +추가: bytes: None, |
| 275 | +추가: packed: None, |
| 276 | +추가: encrypted: false, |
| 277 | +추가: }, |
| 278 | +추가: ]; |
| 279 | +추가: assert_eq!( |
| 280 | +추가: target_directories(&entries, &[0].into_iter().collect(), true), |
| 281 | +추가: ["top".into(), "top/empty".into(), "top/nested".into()] |
| 282 | +추가: .into_iter() |
| 283 | +추가: .collect() |
| 284 | +추가: ); |
| 285 | +추가: assert_eq!( |
| 286 | +추가: target_directories(&entries, &[2].into_iter().collect(), true), |
| 287 | +추가: ["top".into(), "top/nested".into()].into_iter().collect() |
| 288 | +추가: ); |
| 289 | +추가: } |
| 290 | +추가: |
| 170 | 291 | #[test] |
| 171 | 292 | fn duplicate_names_prevent_file_completion_assumptions() { |
| 172 | 293 | let entry = Entry { |
| | @@ -179,7 +300,7 @@ fn duplicate_names_prevent_file_completion_assumptions() { |
| 179 | 300 | }; |
| 180 | 301 | assert!(target_files(&[entry.clone(), entry], &BTreeSet::new(), false, None).is_none()); |
| 181 | 302 | assert_eq!( |
| 182 | | -삭제: warnings(Some(&terminal()), true, None, &[]), |
| 303 | +추가: warnings(Some(&terminal()), true, None, &BTreeSet::new(), &[]), |
| 183 | 304 | vec![UNCERTAIN] |
| 184 | 305 | ); |
| 185 | 306 | } |
| | @@ -539,6 +660,26 @@ mod widgets { |
| 539 | 660 | }, |
| 540 | 661 | ]); |
| 541 | 662 | } |
| 663 | +추가: for _ in 0..40 { |
| 664 | +추가: if ctx |
| 665 | +추가: .memory(|memory| memory.focused()) |
| 666 | +추가: .and_then(|id| ctx.read_response(id)) |
| 667 | +추가: .is_some_and(|response| response.rect.contains(confirm)) |
| 668 | +추가: { |
| 669 | +추가: break; |
| 670 | +추가: } |
| 671 | +추가: draw(vec![key(egui::Key::Tab)]); |
| 672 | +추가: let mut released = key(egui::Key::Tab); |
| 673 | +추가: if let egui::Event::Key { pressed, .. } = &mut released { |
| 674 | +추가: *pressed = false; |
| 675 | +추가: } |
| 676 | +추가: draw(vec![released]); |
| 677 | +추가: } |
| 678 | +추가: assert!( |
| 679 | +추가: ctx.memory(|memory| memory.focused()) |
| 680 | +추가: .and_then(|id| ctx.read_response(id)) |
| 681 | +추가: .is_some_and(|response| response.rect.contains(confirm)) |
| 682 | +추가: ); |
| 542 | 683 | draw(vec![key(egui::Key::Enter)]); |
| 543 | 684 | assert!(matches!(result, Some(Choice::Paths(ref paths)) if paths == &vec![file])); |
| 544 | 685 | } |
| | @@ -626,6 +767,287 @@ mod widgets { |
| 626 | 767 | } |
| 627 | 768 | } |
| 628 | 769 | |
| 770 | +추가: fn policy_render( |
| 771 | +추가: ctx: &egui::Context, |
| 772 | +추가: app: &mut ArchiveApp, |
| 773 | +추가: events: Vec<egui::Event>, |
| 774 | +추가: ) -> Vec<(String, egui::Pos2)> { |
| 775 | +추가: let mut output = ctx.run_ui( |
| 776 | +추가: egui::RawInput { |
| 777 | +추가: screen_rect: Some(egui::Rect::from_min_size( |
| 778 | +추가: egui::Pos2::ZERO, |
| 779 | +추가: egui::vec2(1060.0, 720.0), |
| 780 | +추가: )), |
| 781 | +추가: events, |
| 782 | +추가: ..Default::default() |
| 783 | +추가: }, |
| 784 | +추가: |ui| app.show(ui), |
| 785 | +추가: ); |
| 786 | +추가: output.textures_delta.clear(); |
| 787 | +추가: labels(&output.shapes) |
| 788 | +추가: } |
| 789 | +추가: |
| 790 | +추가: fn policy_focus(ctx: &egui::Context, app: &mut ArchiveApp, label: &str) { |
| 791 | +추가: policy_render(ctx, app, vec![]); |
| 792 | +추가: for _ in 0..100 { |
| 793 | +추가: let shown = policy_render(ctx, app, vec![]); |
| 794 | +추가: let point = shown |
| 795 | +추가: .iter() |
| 796 | +추가: .rev() |
| 797 | +추가: .find(|(text, _)| text == label) |
| 798 | +추가: .unwrap_or_else(|| panic!("표시 없음: {label}")) |
| 799 | +추가: .1; |
| 800 | +추가: if ctx |
| 801 | +추가: .memory(|memory| memory.focused()) |
| 802 | +추가: .and_then(|id| ctx.read_response(id)) |
| 803 | +추가: .is_some_and(|response| response.rect.contains(point)) |
| 804 | +추가: { |
| 805 | +추가: return; |
| 806 | +추가: } |
| 807 | +추가: policy_render(ctx, app, vec![key(egui::Key::Tab)]); |
| 808 | +추가: let mut released = key(egui::Key::Tab); |
| 809 | +추가: if let egui::Event::Key { pressed, .. } = &mut released { |
| 810 | +추가: *pressed = false; |
| 811 | +추가: } |
| 812 | +추가: policy_render(ctx, app, vec![released]); |
| 813 | +추가: } |
| 814 | +추가: panic!("키보드 초점 없음: {label}"); |
| 815 | +추가: } |
| 816 | +추가: |
| 817 | +추가: fn policy_click(ctx: &egui::Context, app: &mut ArchiveApp, label: &str) { |
| 818 | +추가: policy_render(ctx, app, vec![]); |
| 819 | +추가: let point = policy_render(ctx, app, vec![]) |
| 820 | +추가: .iter() |
| 821 | +추가: .rev() |
| 822 | +추가: .find(|(text, _)| text == label) |
| 823 | +추가: .unwrap() |
| 824 | +추가: .1; |
| 825 | +추가: for pressed in [true, false] { |
| 826 | +추가: policy_render( |
| 827 | +추가: ctx, |
| 828 | +추가: app, |
| 829 | +추가: vec![ |
| 830 | +추가: egui::Event::PointerMoved(point), |
| 831 | +추가: egui::Event::PointerButton { |
| 832 | +추가: pos: point, |
| 833 | +추가: button: egui::PointerButton::Primary, |
| 834 | +추가: pressed, |
| 835 | +추가: modifiers: egui::Modifiers::NONE, |
| 836 | +추가: }, |
| 837 | +추가: ], |
| 838 | +추가: ); |
| 839 | +추가: } |
| 840 | +추가: } |
| 841 | +추가: |
| 842 | +추가: #[test] |
| 843 | +추가: fn secondary_button_enter_matrix_never_starts_creation_or_extraction() { |
| 844 | +추가: let cases = vec![ |
| 845 | +추가: ("archive", "ZIP 만들기"), |
| 846 | +추가: ("archive", "다른 파일"), |
| 847 | +추가: ("archive", "폴더 바꾸기"), |
| 848 | +추가: ("archive", "선택한 항목만 풀기"), |
| 849 | +추가: ("create", "파일 추가"), |
| 850 | +추가: ("create", "폴더 추가"), |
| 851 | +추가: ("create", "빼기"), |
| 852 | +추가: ("create", "폴더 바꾸기"), |
| 853 | +추가: ("create", "암호로 보호하기"), |
| 854 | +추가: ("create", "자세한 설정"), |
| 855 | +추가: ("create", "취소"), |
| 856 | +추가: ("result", "자세히 보기"), |
| 857 | +추가: ("result", "자세히 닫기"), |
| 858 | +추가: ("result", "확인"), |
| 859 | +추가: ("progress", "취소"), |
| 860 | +추가: ("close-confirm", "계속 작업"), |
| 861 | +추가: ("close-confirm", "취소하고 닫기"), |
| 862 | +추가: ("close-wait", "닫기 취소"), |
| 863 | +추가: ("close-review", "계속 작업"), |
| 864 | +추가: ("close-review", "닫기"), |
| 865 | +추가: ]; |
| 866 | +추가: let mut cases = cases |
| 867 | +추가: .into_iter() |
| 868 | +추가: .map(|(state, label)| (state, label.to_owned())) |
| 869 | +추가: .collect::<Vec<_>>(); |
| 870 | +추가: for state in [ |
| 871 | +추가: "picker-open", |
| 872 | +추가: "picker-destination", |
| 873 | +추가: "picker-files", |
| 874 | +추가: "picker-folder", |
| 875 | +추가: "picker-zip", |
| 876 | +추가: ] { |
| 877 | +추가: for (label, _) in shortcuts() { |
| 878 | +추가: cases.push((state, label)); |
| 879 | +추가: } |
| 880 | +추가: for label in ["상위 폴더", "취소", "breadcrumb"] { |
| 881 | +추가: cases.push((state, label.to_owned())); |
| 882 | +추가: } |
| 883 | +추가: } |
| 884 | +추가: for (state, label) in cases { |
| 885 | +추가: let scratch = Folder::new(); |
| 886 | +추가: let factory = FakeFactory::default(); |
| 887 | +추가: let ctx = egui::Context::default(); |
| 888 | +추가: let creating = matches!( |
| 889 | +추가: state, |
| 890 | +추가: "create" | "picker-files" | "picker-folder" | "picker-zip" |
| 891 | +추가: ); |
| 892 | +추가: let mut app = ArchiveApp::new( |
| 893 | +추가: Box::new(factory.clone()), |
| 894 | +추가: (!creating).then(|| scratch.0.join("sample.zip")), |
| 895 | +추가: false, |
| 896 | +추가: ); |
| 897 | +추가: if !creating { |
| 898 | +추가: pump(&mut app.model); |
| 899 | +추가: } |
| 900 | +추가: factory.state.borrow_mut().manual = true; |
| 901 | +추가: if creating { |
| 902 | +추가: let source = scratch.0.join("source.txt"); |
| 903 | +추가: fs::write(&source, "fixture").unwrap(); |
| 904 | +추가: app.add_sources(vec![source]); |
| 905 | +추가: } |
| 906 | +추가: if matches!( |
| 907 | +추가: state, |
| 908 | +추가: "progress" | "result" | "close-confirm" | "close-wait" | "close-review" |
| 909 | +추가: ) { |
| 910 | +추가: assert!(app.begin_extract()); |
| 911 | +추가: if matches!(state, "result" | "close-review") { |
| 912 | +추가: let mut worker = factory.state.borrow_mut(); |
| 913 | +추가: worker.frame(Event::Accepted { encryption: false }); |
| 914 | +추가: worker.finish(Outcome::Failed, Publication::None); |
| 915 | +추가: drop(worker); |
| 916 | +추가: for _ in 0..30 { |
| 917 | +추가: policy_render(&ctx, &mut app, vec![]); |
| 918 | +추가: } |
| 919 | +추가: } |
| 920 | +추가: if state.starts_with("close-") { |
| 921 | +추가: app.model.request_close(); |
| 922 | +추가: if state == "close-wait" { |
| 923 | +추가: app.model.confirm_close(); |
| 924 | +추가: } |
| 925 | +추가: } |
| 926 | +추가: } |
| 927 | +추가: match state { |
| 928 | +추가: "picker-open" => policy_click(&ctx, &mut app, "다른 파일"), |
| 929 | +추가: "picker-destination" | "picker-zip" => policy_click(&ctx, &mut app, "폴더 바꾸기"), |
| 930 | +추가: "picker-files" => policy_click(&ctx, &mut app, "파일 추가"), |
| 931 | +추가: "picker-folder" => policy_click(&ctx, &mut app, "폴더 추가"), |
| 932 | +추가: _ => {} |
| 933 | +추가: } |
| 934 | +추가: if state == "result" && label == "자세히 닫기" { |
| 935 | +추가: policy_click(&ctx, &mut app, "자세히 보기"); |
| 936 | +추가: } |
| 937 | +추가: let before = factory.state.borrow().starts.len(); |
| 938 | +추가: let label = if label == "breadcrumb" { |
| 939 | +추가: scratch |
| 940 | +추가: .0 |
| 941 | +추가: .ancestors() |
| 942 | +추가: .last() |
| 943 | +추가: .unwrap() |
| 944 | +추가: .as_os_str() |
| 945 | +추가: .to_str() |
| 946 | +추가: .unwrap() |
| 947 | +추가: } else { |
| 948 | +추가: label.as_str() |
| 949 | +추가: }; |
| 950 | +추가: policy_focus(&ctx, &mut app, label); |
| 951 | +추가: policy_render(&ctx, &mut app, vec![key(egui::Key::Enter)]); |
| 952 | +추가: policy_render(&ctx, &mut app, vec![]); |
| 953 | +추가: assert_eq!( |
| 954 | +추가: factory.state.borrow().starts.len(), |
| 955 | +추가: before, |
| 956 | +추가: "{state}: {label}" |
| 957 | +추가: ); |
| 958 | +추가: } |
| 959 | +추가: let scratch = Folder::new(); |
| 960 | +추가: let factory = FakeFactory::default(); |
| 961 | +추가: let mut app = loaded(&scratch, &factory); |
| 962 | +추가: factory.state.borrow_mut().manual = true; |
| 963 | +추가: let ctx = egui::Context::default(); |
| 964 | +추가: policy_focus(&ctx, &mut app, "풀기"); |
| 965 | +추가: policy_render(&ctx, &mut app, vec![key(egui::Key::Enter)]); |
| 966 | +추가: assert!(matches!( |
| 967 | +추가: factory.state.borrow().starts.last(), |
| 968 | +추가: Some(Start::Extract { .. }) |
| 969 | +추가: )); |
| 970 | +추가: assert_eq!(factory.state.borrow().starts.len(), 2); |
| 971 | +추가: } |
| 972 | +추가: |
| 973 | +추가: #[test] |
| 974 | +추가: fn password_secondary_enter_does_not_submit_valid_input() { |
| 975 | +추가: for encrypt in [false, true] { |
| 976 | +추가: for label in ["보기", "숨기기", "취소"] { |
| 977 | +추가: let scratch = Folder::new(); |
| 978 | +추가: let factory = FakeFactory::manual(); |
| 979 | +추가: let mut app = ArchiveApp::new(Box::new(factory.clone()), None, false); |
| 980 | +추가: assert!(app.model.begin( |
| 981 | +추가: Start::CreateZip { |
| 982 | +추가: sources: vec![(scratch.0.join("source"), "source".into())], |
| 983 | +추가: output_file: scratch.0.join("output.zip"), |
| 984 | +추가: method: Method::Deflate, |
| 985 | +추가: aes256: true |
| 986 | +추가: }, |
| 987 | +추가: &mut factory.clone() |
| 988 | +추가: )); |
| 989 | +추가: { |
| 990 | +추가: let mut worker = factory.state.borrow_mut(); |
| 991 | +추가: worker.frame(Event::Accepted { encryption: true }); |
| 992 | +추가: worker.frame(Event::PasswordRequired { |
| 993 | +추가: challenge_id: 17, |
| 994 | +추가: attempt: 1, |
| 995 | +추가: encrypt, |
| 996 | +추가: }); |
| 997 | +추가: } |
| 998 | +추가: let ctx = egui::Context::default(); |
| 999 | +추가: for _ in 0..12 { |
| 1000 | +추가: policy_render(&ctx, &mut app, vec![]); |
| 1001 | +추가: } |
| 1002 | +추가: text(&ctx, &mut app, "archive-password-input", "fixture-secret"); |
| 1003 | +추가: if encrypt { |
| 1004 | +추가: text(&ctx, &mut app, "archive-password-confirm", "fixture-secret"); |
| 1005 | +추가: } |
| 1006 | +추가: if label == "숨기기" { |
| 1007 | +추가: policy_click(&ctx, &mut app, "보기"); |
| 1008 | +추가: } |
| 1009 | +추가: policy_focus(&ctx, &mut app, label); |
| 1010 | +추가: policy_render(&ctx, &mut app, vec![key(egui::Key::Enter)]); |
| 1011 | +추가: assert!(!factory.state.borrow().password_seen, "{label}"); |
| 1012 | +추가: assert_eq!(factory.state.borrow().starts.len(), 1); |
| 1013 | +추가: } |
| 1014 | +추가: } |
| 1015 | +추가: } |
| 1016 | +추가: |
| 1017 | +추가: #[test] |
| 1018 | +추가: fn directory_only_extraction_displays_success() { |
| 1019 | +추가: let scratch = Folder::new(); |
| 1020 | +추가: let factory = FakeFactory::default(); |
| 1021 | +추가: let mut app = loaded(&scratch, &factory); |
| 1022 | +추가: app.model.entries = vec![Entry { |
| 1023 | +추가: id: 0, |
| 1024 | +추가: name: "empty".into(), |
| 1025 | +추가: kind: Kind::Directory, |
| 1026 | +추가: bytes: Some(0), |
| 1027 | +추가: packed: None, |
| 1028 | +추가: encrypted: false, |
| 1029 | +추가: }]; |
| 1030 | +추가: factory.state.borrow_mut().manual = true; |
| 1031 | +추가: assert!(app.begin_extract()); |
| 1032 | +추가: { |
| 1033 | +추가: let mut worker = factory.state.borrow_mut(); |
| 1034 | +추가: worker.frame(Event::Accepted { encryption: false }); |
| 1035 | +추가: worker.frame(Event::Output { |
| 1036 | +추가: entry_id: None, |
| 1037 | +추가: relative_name: "empty".into(), |
| 1038 | +추가: disposition: Disposition::Created, |
| 1039 | +추가: }); |
| 1040 | +추가: worker.finish(Outcome::Completed, Publication::Complete); |
| 1041 | +추가: } |
| 1042 | +추가: let ctx = egui::Context::default(); |
| 1043 | +추가: for _ in 0..30 { |
| 1044 | +추가: policy_render(&ctx, &mut app, vec![]); |
| 1045 | +추가: } |
| 1046 | +추가: let shown = policy_render(&ctx, &mut app, vec![]); |
| 1047 | +추가: assert!(shown.iter().any(|(text, _)| text == "압축을 풀었습니다")); |
| 1048 | +추가: assert!(!shown.iter().any(|(text, _)| text == UNCERTAIN)); |
| 1049 | +추가: } |
| 1050 | +추가: |
| 629 | 1051 | fn picker_frame( |
| 630 | 1052 | ctx: &egui::Context, |
| 631 | 1053 | picker: &mut Picker, |