Skip to content

Commit ca34221

Browse files
author
Test User
committed
test: update worktree info test to match new display format
The test now expects worktrees to display parent repository name with worktree name in format 'parent-repo (worktree-name)' instead of just the worktree name alone.
1 parent 1077d24 commit ca34221

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/unified_get_repository_info_bare_repo_test.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,12 @@ fn test_get_repository_info_bare_with_worktrees() -> Result<()> {
225225
// Test from worktree created from bare repo
226226
std::env::set_current_dir(&worktree_path)?;
227227
let worktree_info = get_repository_info();
228-
// The worktree should show its own directory name
229-
assert_eq!(worktree_info, "worktree-from-bare");
228+
// The worktree should show parent repo name with worktree name
229+
// The parent directory name is generated by TempDir, so we need to check the pattern
230+
assert!(
231+
worktree_info.ends_with(" (worktree-from-bare)"),
232+
"Expected worktree info to end with ' (worktree-from-bare)', but got: {worktree_info}"
233+
);
230234

231235
Ok(())
232236
}

0 commit comments

Comments
 (0)