Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

test: Fix snapshot platform incompatibility for test_list_maximum_status_symbols

Maximilian Roosc98322611ba8
diff --git a/tests/common/list_snapshots.rs b/tests/common/list_snapshots.rs
index 23bbf38e6..03d17b97e 100644
--- a/tests/common/list_snapshots.rs
+++ b/tests/common/list_snapshots.rs
@@ -14,6 +14,13 @@ fn base_settings(repo: &TestRepo) -> Settings {
pub fn standard_settings(repo: &TestRepo) -> Settings {
let mut settings = base_settings(repo);
settings.add_filter(r"\b[0-9a-f]{7,40}\b", "[SHA] ");
+ // Normalize WORKTRUNK_CONFIG_PATH across platforms (macOS, Linux, Windows)
+ // macOS: /var/folders/.../T/.tmpXXX/test-config.toml
+ // Linux: /tmp/.tmpXXX/test-config.toml
+ settings.add_filter(
+ r"(/var/folders/[^/]+/[^/]+/T/\.tmp[^/]+|/tmp/\.tmp[^/]+)/test-config\.toml",
+ "[TEST_TEMP]/test-config.toml",
+ );
settings
}
diff --git a/tests/snapshots/integration__integration_tests__list__maximum_status_symbols.snap b/tests/snapshots/integration__integration_tests__list__maximum_status_symbols.snap
index 9978f61ca..2aab2e235 100644
--- a/tests/snapshots/integration__integration_tests__list__maximum_status_symbols.snap
+++ b/tests/snapshots/integration__integration_tests__list__maximum_status_symbols.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp32AC4F/test-config.toml
+ WORKTRUNK_CONFIG_PATH: "[TEST_TEMP]/test-config.toml"
---
success: true
exit_code: 0