Skip to content

Commit 1ec94a1

Browse files
wesmclaude
andcommitted
fix: remove personal username from test fixtures and comments
Replace hardcoded username in file path examples with generic placeholders in tests and doc comments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3174c03 commit 1ec94a1

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

internal/parser/parser_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ func TestGetProjectName(t *testing.T) {
2020
}{
2121
{"simple name", "my-project", "my_project"},
2222
{"encoded path with code",
23-
"-Users-wesm-code-my-app", "my_app"},
23+
"-Users-alice-code-my-app", "my_app"},
2424
{"encoded path with projects",
25-
"-Users-wesm-projects-api-server", "api_server"},
25+
"-Users-alice-projects-api-server", "api_server"},
2626
{"encoded path with repos",
2727
"-home-user-repos-frontend", "frontend"},
2828
{"encoded path without marker",
29-
"-Users-wesm", "wesm"},
29+
"-Users-alice", "alice"},
3030
{"empty", "", ""},
3131
{"no prefix", "plain_name", "plain_name"},
3232
{"with src marker",
33-
"-Users-wesm-src-my-lib", "my_lib"},
33+
"-Users-alice-src-my-lib", "my_lib"},
3434
{"multi-word after marker",
35-
"-Users-wesm-code-my-cool-project", "my_cool_project"},
35+
"-Users-alice-code-my-cool-project", "my_cool_project"},
3636
{"deeply nested",
37-
"-Users-wesm-code-org-team-repo", "org_team_repo"},
37+
"-Users-alice-code-org-team-repo", "org_team_repo"},
3838
{"unicode components",
39-
"-Users-wesm-code-café-app", "café_app"},
39+
"-Users-alice-code-café-app", "café_app"},
4040
{"trailing dash",
41-
"-Users-wesm-code-myapp-", "myapp_"},
41+
"-Users-alice-code-myapp-", "myapp_"},
4242
{"double dashes",
43-
"-Users-wesm-code--my-app", "_my_app"},
43+
"-Users-alice-code--my-app", "_my_app"},
4444
}
4545

4646
for _, tt := range tests {
@@ -59,7 +59,7 @@ func TestExtractProjectFromCwd(t *testing.T) {
5959
cwd string
6060
want string
6161
}{
62-
{"/Users/wesm/code/my-app", "my_app"},
62+
{"/Users/alice/code/my-app", "my_app"},
6363
{"/home/user/projects/api-server", "api_server"},
6464
{"", ""},
6565
{"/", ""},
@@ -99,7 +99,7 @@ func TestNeedsProjectReparse(t *testing.T) {
9999
want bool
100100
}{
101101
{"my_project", false},
102-
{"_Users_wesm_code_app", true},
102+
{"_Users_alice_code_app", true},
103103
{"_home_user_project", true},
104104
{"_private_var_folders", true},
105105
{"good_project_var_folders_ok", true},
@@ -580,7 +580,7 @@ func TestIsClaudeSystemMessage(t *testing.T) {
580580

581581
func TestParseClaudeSession(t *testing.T) {
582582
validContent := testjsonl.JoinJSONL(
583-
testjsonl.ClaudeUserJSON("Fix the login bug", tsEarly, "/Users/wesm/code/my-app"),
583+
testjsonl.ClaudeUserJSON("Fix the login bug", tsEarly, "/Users/alice/code/my-app"),
584584
testjsonl.ClaudeAssistantJSON([]map[string]any{
585585
{"type": "text", "text": "Looking at the auth module..."},
586586
{"type": "tool_use", "name": "Read", "input": map[string]string{"file_path": "src/auth.ts"}},
@@ -842,7 +842,7 @@ func TestParseCodexSession(t *testing.T) {
842842
{
843843
name: "standard session",
844844
content: testjsonl.JoinJSONL(
845-
testjsonl.CodexSessionMetaJSON("abc-123", "/Users/wesm/code/my-api", "user", tsEarly),
845+
testjsonl.CodexSessionMetaJSON("abc-123", "/Users/alice/code/my-api", "user", tsEarly),
846846
testjsonl.CodexMsgJSON("user", "Add rate limiting", tsEarlyS1),
847847
testjsonl.CodexMsgJSON("assistant", "I'll add rate limiting to the API.", tsEarlyS5),
848848
),
@@ -904,7 +904,7 @@ func TestParseCodexSession(t *testing.T) {
904904
{
905905
name: "function calls",
906906
content: testjsonl.JoinJSONL(
907-
testjsonl.CodexSessionMetaJSON("fc-1", "/Users/wesm/code/app", "user", tsEarly),
907+
testjsonl.CodexSessionMetaJSON("fc-1", "/Users/alice/code/app", "user", tsEarly),
908908
testjsonl.CodexMsgJSON("user", "Run the tests", tsEarlyS1),
909909
testjsonl.CodexFunctionCallJSON("shell_command", "Running tests", tsEarlyS5),
910910
testjsonl.CodexFunctionCallJSON("apply_patch", "Fixing typo", tsLate),
@@ -1025,7 +1025,7 @@ func TestParseCodexSession(t *testing.T) {
10251025
{
10261026
name: "second session_meta with unparsable cwd resets project",
10271027
content: testjsonl.JoinJSONL(
1028-
testjsonl.CodexSessionMetaJSON("multi", "/Users/wesm/code/my-api", "user", tsEarly),
1028+
testjsonl.CodexSessionMetaJSON("multi", "/Users/alice/code/my-api", "user", tsEarly),
10291029
testjsonl.CodexMsgJSON("user", "hello", tsEarlyS1),
10301030
testjsonl.CodexSessionMetaJSON("multi", "/", "user", "2024-01-01T10:00:02Z"),
10311031
),
@@ -1186,8 +1186,8 @@ func TestExtractCwdFromSession(t *testing.T) {
11861186
}{
11871187
{
11881188
"has cwd field",
1189-
`{"type":"user","timestamp":"2024-01-01T00:00:00Z","message":{"content":"hi"},"cwd":"/Users/wesm/code/my-app"}` + "\n",
1190-
"/Users/wesm/code/my-app",
1189+
`{"type":"user","timestamp":"2024-01-01T00:00:00Z","message":{"content":"hi"},"cwd":"/Users/alice/code/my-app"}` + "\n",
1190+
"/Users/alice/code/my-app",
11911191
},
11921192
{
11931193
"no cwd field",

internal/parser/project.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func normalizeName(s string) string {
2020

2121
// GetProjectName converts an encoded Claude project directory name
2222
// to a clean project name. Claude encodes paths like
23-
// /Users/wesm/code/my-app as -Users-wesm-code-my-app.
23+
// /Users/alice/code/my-app as -Users-alice-code-my-app.
2424
func GetProjectName(dirName string) string {
2525
if dirName == "" {
2626
return ""

internal/sync/engine_integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ func TestSyncEngineIntegration(t *testing.T) {
7777
env := setupTestEnv(t)
7878

7979
content := testjsonl.NewSessionBuilder().
80-
AddClaudeUser(tsEarly, "Hello", "/Users/wesm/code/my-app").
80+
AddClaudeUser(tsEarly, "Hello", "/Users/alice/code/my-app").
8181
AddClaudeAssistant(tsEarlyS5, "Hi there!").
8282
String()
8383

8484
env.writeClaudeSession(
85-
t, "-Users-wesm-code-my-app",
85+
t, "-Users-alice-code-my-app",
8686
"test-session.jsonl", content,
8787
)
8888

@@ -408,7 +408,7 @@ func TestSyncSingleSessionProjectFallback(t *testing.T) {
408408
})
409409

410410
// Case B: Bad project -> should fall back to directory
411-
env.updateSessionProject(t, "fallback-test", "_Users_wesm_bad")
411+
env.updateSessionProject(t, "fallback-test", "_Users_alice_bad")
412412

413413
err = env.engine.SyncSingleSession("fallback-test")
414414
if err != nil {

internal/sync/sync_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,20 +340,20 @@ func TestFindGeminiSourceFile(t *testing.T) {
340340
}
341341

342342
func TestGeminiPathHash(t *testing.T) {
343-
// Known SHA-256 of "/Users/wesm/code/roborev"
344-
hash := geminiPathHash("/Users/wesm/code/roborev")
343+
// Known SHA-256 of "/Users/alice/code/sample-repo"
344+
hash := geminiPathHash("/Users/alice/code/sample-repo")
345345
if len(hash) != 64 {
346346
t.Errorf("hash length = %d, want 64", len(hash))
347347
}
348348
// Hash should be deterministic
349-
if geminiPathHash("/Users/wesm/code/roborev") != hash {
349+
if geminiPathHash("/Users/alice/code/sample-repo") != hash {
350350
t.Error("hash not deterministic")
351351
}
352352
}
353353

354354
func TestBuildGeminiProjectMap(t *testing.T) {
355355
dir := t.TempDir()
356-
projectsJSON := `{"projects":{"/Users/wesm/code/my-app":"my-app"}}`
356+
projectsJSON := `{"projects":{"/Users/alice/code/my-app":"my-app"}}`
357357
if err := os.WriteFile(
358358
filepath.Join(dir, "projects.json"),
359359
[]byte(projectsJSON), 0o644,
@@ -362,7 +362,7 @@ func TestBuildGeminiProjectMap(t *testing.T) {
362362
}
363363

364364
m := buildGeminiProjectMap(dir)
365-
hash := geminiPathHash("/Users/wesm/code/my-app")
365+
hash := geminiPathHash("/Users/alice/code/my-app")
366366
if m[hash] != "my_app" {
367367
t.Errorf("project for hash = %q, want %q",
368368
m[hash], "my_app")

0 commit comments

Comments
 (0)