Improve structural test diagnostics

This commit is contained in:
2026-09-05 18:08:49 +00:00
parent 85663f5bc9
commit 204caf9d24
10 changed files with 64 additions and 36 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"os"
"path/filepath"
"reflect"
"slices"
"strings"
"testing"
@@ -32,7 +32,7 @@ func TestRestorePlanDefaultScope(t *testing.T) {
got := actionRelPaths(plan.Actions)
want := []string{"artifacts/session_recap.md", "manifest.json", "transcripts/full.json"}
if !reflect.DeepEqual(got, want) {
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
if plan.DownloadCount != 3 || plan.SkipSameCount != 0 || plan.ConflictCount != 0 {
@@ -54,7 +54,7 @@ func TestRestorePlanIncludeAudio(t *testing.T) {
}
got := actionRelPaths(plan.Actions)
want := []string{"audio/alice.flac", "manifest.json"}
if !reflect.DeepEqual(got, want) {
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
}
@@ -112,7 +112,7 @@ func TestRestorePlanIncludesPreviousCacheByDefault(t *testing.T) {
got := actionRelPaths(plan.Actions)
want := []string{"manifest.json", "previous/artifacts/session_recap.md", "previous/manifest.json"}
if !reflect.DeepEqual(got, want) {
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
}
@@ -133,7 +133,7 @@ func TestRestorePlanIgnoresCurrentSessionArchivedPreviousCache(t *testing.T) {
got := actionRelPaths(plan.Actions)
want := []string{"manifest.json"}
if !reflect.DeepEqual(got, want) {
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
}
@@ -154,7 +154,7 @@ func TestRestorePlanMissingOptionalPreviousCacheSkipsArtifact(t *testing.T) {
got := actionRelPaths(plan.Actions)
want := []string{"manifest.json", "previous/manifest.json"}
if !reflect.DeepEqual(got, want) {
if !slices.Equal(got, want) {
t.Fatalf("action local paths = %#v, want %#v", got, want)
}
}