mirror of
https://github.com/max-sixty/worktrunk.git
synced 2026-09-14 20:00:38 +08:00
test(config): assert --print leaves the linked worktree's config unmigrated
The write-freedom assertion checked the main worktree's .config/wt.toml, which the command never touches when run from a linked worktree: project_config_path() resolves against the current worktree root, so the file read — and the one a regression would rewrite — is <feature-print>/.config/wt.toml. Assert on that copy too.
This commit is contained in:
@@ -5333,6 +5333,12 @@ fn test_config_update_print_emits_project_config_from_linked_worktree(repo: Test
|
||||
"--print must keep stderr empty for pipe-friendliness, got: {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
assert!(
|
||||
fs::read_to_string(feature_path.join(".config").join("wt.toml"))
|
||||
.unwrap()
|
||||
.contains("{{ main_worktree }}"),
|
||||
"--print must leave the linked worktree's config — the file it actually read — unmigrated"
|
||||
);
|
||||
assert_eq!(
|
||||
fs::read_to_string(&project_config_path).unwrap(),
|
||||
before,
|
||||
|
||||
Reference in New Issue
Block a user