4a40539ece
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
940 B
Go
27 lines
940 B
Go
package server
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/protocol"
|
|
)
|
|
|
|
func TestTurnDiffDropsTheHarnessHomeInsideTheFolder(t *testing.T) {
|
|
changes := &protocol.StageFileChanges{Status: "complete", Files: []protocol.FileChange{
|
|
{Path: ".claude-profile/.claude.json"},
|
|
{Path: ".claude-profile/projects/x/1.jsonl"},
|
|
{Path: ".claude-profile-notes.md"},
|
|
{Path: "src/app.py"},
|
|
}}
|
|
got := withoutHarnessState(changes, "/w/caplens", []string{"/w/caplens/.claude-profile", "/home/me/.claude"})
|
|
if len(got.Files) != 2 || got.Files[0].Path != ".claude-profile-notes.md" || got.Files[1].Path != "src/app.py" {
|
|
t.Fatalf("files = %+v", got.Files)
|
|
}
|
|
if len(changes.Files) != 4 {
|
|
t.Fatalf("input changed: %+v", changes.Files)
|
|
}
|
|
if same := withoutHarnessState(changes, "/w/caplens", []string{"/home/me/.claude"}); same != changes {
|
|
t.Fatal("no harness dir inside the folder should keep the changes as they are")
|
|
}
|
|
}
|