1//go:build unix23package spec45import (6 "path/filepath"7 "syscall"8 "testing"9 "time"10)1112// A FIFO in a change dir must not block Load: reading it would hang forever.13func TestLoadIgnoresFIFO(t *testing.T) {14 root := copyFixture(t)15 if err := syscall.Mkfifo(filepath.Join(root, "openspec", "changes", "add-due-dates", "pipe.md"), 0o644); err != nil {16 t.Skip("mkfifo unsupported:", err)17 }18 done := make(chan *Snapshot, 1)19 go func() { done <- mustLoad(t, root) }()20 select {21 case s := <-done:22 if len(s.Changes) != 5 {23 t.Errorf("Changes = %v, want the 5 fixture changes", changeIDs(s.Changes))24 }25 case <-time.After(5 * time.Second):26 t.Fatal("Load blocked on a FIFO")27 }28}