Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
test(list): exercise real wide-char branch names in width test (#3511)
Worktrunk Botcda508019598
diff --git a/tests/integration_tests/spacing_edge_cases.rs b/tests/integration_tests/spacing_edge_cases.rsindex 0f11a3c96..70080d4ef 100644--- a/tests/integration_tests/spacing_edge_cases.rs+++ b/tests/integration_tests/spacing_edge_cases.rs@@ -48,11 +48,15 @@ fn test_long_branch_names_longer_than_header(mut repo: TestRepo) {#[rstest]fn test_unicode_branch_names_width_calculation(mut repo: TestRepo) {- // Create worktrees with unicode characters that have different visual widths- // Note: Git may have restrictions on branch names, so use valid characters- repo.add_worktree("cafe");- repo.add_worktree("naive");- repo.add_worktree("resume");+ // Wide (CJK) branch names whose display width differs from both their byte+ // length and their char count — the list renderer pads columns by+ // `unicode_width` display cells, so a byte- or char-count layout would+ // misalign the Branch and Path columns for these. `日本語` is 3 chars /+ // 9 bytes / 6 display cells; `中文` is 2 chars / 6 bytes / 4 cells. ASCII+ // names (byte == char == cell) never exercise that path.+ repo.add_worktree("日本語");+ repo.add_worktree("中文");+ repo.add_worktree("café");snapshot_list("unicode_branch_names", &repo);}diff --git a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snapindex 37aae944f..05235cdc2 100644--- a/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap+++ b/tests/snapshots/integration__integration_tests__spacing_edge_cases__unicode_branch_names.snap@@ -35,6 +35,7 @@ info:WORKTRUNK_TEST_GEMINI_INSTALLED: "0"WORKTRUNK_TEST_NUSHELL_ENV: "0"WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"+ WORKTRUNK_TEST_PARENT_SHELL: ""WORKTRUNK_TEST_POWERSHELL_ENV: "0"WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"@@ -46,12 +47,12 @@ exit_code: 0----- stdout -----[1mBranch[0m [1mStatus[0m [1mHEAD±[0m [1mmain↕[0m [1mmain…±[0m [1mRemote⇅[0m [1mPath[0m [1mCommit[0m [1mAge[0m [1mMessage[0m@ main [2m^[22m[2m|[22m [2m|[0m . [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m-+ [2mcafe[0m [2m_[22m [2m../repo.cafe[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m++ [2mcafé[0m [2m_[22m [2m../repo.café[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m+ feature-a [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-a [2m1b87d473[0m [2m16h[0m [2mAdd feature-a file[0m+ feature-b [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-b [2mf62940fc[0m [2m16h[0m [2mAdd feature-b file[0m+ feature-c [2m↑[22m [32m↑1[0m [32m+1[0m ../repo.feature-c [2m345c7c93[0m [2m16h[0m [2mAdd feature-c file[0m-+ [2mnaive[0m [2m_[22m [2m../repo.naive[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m-+ [2mresume[0m [2m_[22m [2m../repo.resume[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m++ [2m中文[0m [2m_[22m [2m../repo.中文[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m++ [2m日本語[0m [2m_[22m [2m../repo.日本語[0m [2m05a4a45d[0m [2m16h[0m [2mInitial commit[0m----- stderr -----