| | @@ -443,6 +443,58 @@ fn explorer_open_restores_destination_when_expanded_retry_fails_again() { |
| 443 | 443 | )); |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | +추가: #[test] |
| 447 | +추가: fn explorer_open_pending_after_limit_is_dropped_when_zip_creation_starts() { |
| 448 | +추가: let scratch = Folder::new(); |
| 449 | +추가: let mut s = Explorer::new(&scratch); |
| 450 | +추가: let root = scratch.0.join("sample.zip (Zipelo 임시)"); |
| 451 | +추가: let _limit_ctx = double_click_open_hits_limit(&mut s); |
| 452 | +추가: // 한도 초과 결과를 닫지 않고 폴더를 끌어 놓아 ZIP 만들기를 시작함. |
| 453 | +추가: let folder = scratch.0.join("photos"); |
| 454 | +추가: std::fs::create_dir_all(&folder).unwrap(); |
| 455 | +추가: std::fs::write(folder.join("a.txt"), b"abc").unwrap(); |
| 456 | +추가: s.app.add_sources(vec![folder]); |
| 457 | +추가: let ctx = egui::Context::default(); |
| 458 | +추가: policy_click(&ctx, &mut s.app, "압축하기"); |
| 459 | +추가: assert!(s.app.model.busy()); |
| 460 | +추가: assert!(matches!( |
| 461 | +추가: s.factory.state.borrow().starts.last(), |
| 462 | +추가: Some(Start::CreateZip { .. }) |
| 463 | +추가: )); |
| 464 | +추가: { |
| 465 | +추가: let mut worker = s.factory.state.borrow_mut(); |
| 466 | +추가: worker.frame(Event::Accepted { encryption: false }); |
| 467 | +추가: worker.frame(Event::Output { |
| 468 | +추가: entry_id: None, |
| 469 | +추가: relative_name: "photos.zip".into(), |
| 470 | +추가: disposition: Disposition::Created, |
| 471 | +추가: }); |
| 472 | +추가: worker.finish(Outcome::Completed, Publication::Complete); |
| 473 | +추가: } |
| 474 | +추가: for _ in 0..30 { |
| 475 | +추가: s.frame(egui::Modifiers::NONE, vec![]); |
| 476 | +추가: } |
| 477 | +추가: // 만들기가 끝나도 이전 열기가 적용되지 않아 오류가 뜨지 않음. |
| 478 | +추가: for _ in 0..3 { |
| 479 | +추가: policy_render(&ctx, &mut s.app, vec![]); |
| 480 | +추가: } |
| 481 | +추가: let shown = policy_render(&ctx, &mut s.app, vec![]); |
| 482 | +추가: assert!( |
| 483 | +추가: !shown.iter().any(|(text, _)| text.contains("열지 못했습니다")), |
| 484 | +추가: "{shown:?}" |
| 485 | +추가: ); |
| 486 | +추가: assert!(s.opened.borrow().is_empty()); |
| 487 | +추가: // 풀 위치도 원래대로 돌아옴. |
| 488 | +추가: s.factory.state.borrow_mut().manual = false; |
| 489 | +추가: assert!(s.app.begin_extract()); |
| 490 | +추가: let state = s.factory.state.borrow(); |
| 491 | +추가: let Some(Start::Extract { destination, .. }) = state.starts.last() else { |
| 492 | +추가: panic!("{:?}", state.starts.last()); |
| 493 | +추가: }; |
| 494 | +추가: assert_eq!(destination, &scratch.0.join("sample")); |
| 495 | +추가: assert!(!destination.starts_with(&root)); |
| 496 | +추가: } |
| 497 | +추가: |
| 446 | 498 | #[test] |
| 447 | 499 | fn explorer_double_click_does_not_open_executables() { |
| 448 | 500 | let scratch = Folder::new(); |