MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / blocked_split_does_not_prompt

Function blocked_split_does_not_prompt

atomic-cli/src/commands/view/split.rs:518–536  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 8

recorded_repoFunction · 0.85
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
recordMethod · 0.45
to_base32Method · 0.45
execute_with_repoMethod · 0.45

Tested by

no test coverage detected