Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
49 lines
1.5 KiB
Go
49 lines
1.5 KiB
Go
//go:build darwin
|
|
|
|
package workspace
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestFinderRecentSpotlightQueryKeepsOlderOpenedFiles(t *testing.T) {
|
|
if strings.Contains(finderRecentSpotlightQuery, "$time") {
|
|
t.Fatalf("query = %q, want no rolling date window", finderRecentSpotlightQuery)
|
|
}
|
|
if !strings.Contains(finderRecentSpotlightQuery, "kMDItemLastUsedDate == *") {
|
|
t.Fatalf("query = %q, want all opened files", finderRecentSpotlightQuery)
|
|
}
|
|
}
|
|
|
|
func TestFinderRecentSpotlightQueryExcludesFinderNoise(t *testing.T) {
|
|
for _, predicate := range []string{
|
|
"kMDItemContentTypeTree != 'public.folder'",
|
|
"kMDItemFSName != '*.download'cd",
|
|
} {
|
|
if !strings.Contains(finderRecentSpotlightQuery, predicate) {
|
|
t.Fatalf("query = %q, want predicate %q", finderRecentSpotlightQuery, predicate)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestParseSpotlightRecentCandidatesKeepsUnrankedResultsPastOldCap(t *testing.T) {
|
|
const candidateCount = 450
|
|
var output strings.Builder
|
|
for index := 0; index < candidateCount; index++ {
|
|
fmt.Fprintf(&output, "/workspace/file-%03d.txt\n", index)
|
|
}
|
|
|
|
paths, err := parseSpotlightRecentCandidates(strings.NewReader(output.String()))
|
|
if err != nil {
|
|
t.Fatalf("parseSpotlightRecentCandidates: %v", err)
|
|
}
|
|
if len(paths) != candidateCount {
|
|
t.Fatalf("candidate count = %d, want %d", len(paths), candidateCount)
|
|
}
|
|
if got := paths[candidateCount-1]; got != "/workspace/file-449.txt" {
|
|
t.Fatalf("last candidate = %q, want final unranked Spotlight hit", got)
|
|
}
|
|
}
|