Skip to content

Commit 01cef5a

Browse files
author
Test User
committed
test: fix worktree info tests for macOS and Ubuntu environments
Update test expectations to match the new display format where worktrees show 'parent-repo (worktree-name)' instead of just the worktree name. This fixes CI failures on both macOS and Ubuntu runners.
1 parent ca34221 commit 01cef5a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/unified_get_repository_info_with_worktrees_test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,10 @@ fn test_get_repository_info_bare_repo_with_worktrees() -> Result<()> {
275275
// Test from worktree created from bare repo
276276
std::env::set_current_dir(&worktree_path)?;
277277
let worktree_info = get_repository_info();
278+
// The worktree should show parent repo name with worktree name
278279
assert!(
279-
worktree_info.contains("feature") || worktree_info == "bare-worktree",
280-
"Expected info to contain 'feature' or equal 'bare-worktree', got: {worktree_info}"
280+
worktree_info.ends_with(" (bare-worktree)"),
281+
"Expected info to end with ' (bare-worktree)', got: {worktree_info}"
281282
);
282283

283284
Ok(())
@@ -317,9 +318,10 @@ fn test_get_repository_info_worktree_special_names() -> Result<()> {
317318
// Test from worktree
318319
std::env::set_current_dir(&worktree_path)?;
319320
let worktree_info = get_repository_info();
321+
// The worktree should show parent repo name with worktree name
320322
assert!(
321-
worktree_info.contains(branch_name) || worktree_info == worktree_dir,
322-
"Failed for branch {branch_name}, worktree {worktree_dir}, got: {worktree_info}"
323+
worktree_info.ends_with(&format!(" ({worktree_dir})")),
324+
"Failed for branch {branch_name}, worktree {worktree_dir}, expected to end with ' ({worktree_dir})', got: {worktree_info}"
323325
);
324326

325327
// Clean up worktree for next iteration

0 commit comments

Comments
 (0)