()
| 516 | |
| 517 | #[test] |
| 518 | fn blocked_split_does_not_prompt() { |
| 519 | let (temp, mut repo, hash) = recorded_repo(); |
| 520 | std::fs::write(temp.path().join("f.txt"), "HELLO\n").unwrap(); |
| 521 | repo.record( |
| 522 | repo.require_working_copy_id().unwrap(), |
| 523 | atomic_core::change::ChangeHeader::new("edit file"), |
| 524 | atomic_repository::RecordOptions::default(), |
| 525 | ) |
| 526 | .unwrap(); |
| 527 | let cmd = Split::try_parse_from(["split", "wip", &hash.to_base32()]).unwrap(); |
| 528 | let result = cmd.execute_with_repo(&mut repo, |_| panic!("must not prompt")); |
| 529 | assert!(matches!( |
| 530 | result, |
| 531 | Err(CliError::Repository( |
| 532 | atomic_repository::RepositoryError::ViewSplitHasDependents { .. } |
| 533 | )) |
| 534 | )); |
| 535 | assert!(!repo.view_exists("wip").unwrap()); |
| 536 | } |
| 537 | |
| 538 | #[test] |
| 539 | fn dry_run_and_explicit_confirmation_do_not_prompt() { |
nothing calls this directly
no test coverage detected