Files
narratio/internal/app/operator_inspection_fifo_test.go
Eric Rakestraw 831665c913
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
Align module path with Narratio v4 release
2026-12-03 02:01:48 +00:00

35 lines
910 B
Go

//go:build unix
package app
import (
"path/filepath"
"strings"
"testing"
"gitea.maximumdirect.net/eric/narratio/v4/internal/config"
"golang.org/x/sys/unix"
)
func TestInspectStableInputsRejectsSpeakersFIFO(t *testing.T) {
root := t.TempDir()
sourcePath := filepath.Join(root, "spells.fifo")
if err := unix.Mkfifo(sourcePath, 0o644); err != nil {
t.Fatalf("Mkfifo() error = %v", err)
}
cfg := &config.Config{StableInputs: config.ResolvedStableInputs{
SpeakersFile: config.ResolvedInputFile{Path: sourcePath, ConfigPath: filepath.Join(root, "campaign.yml")},
}}
for _, check := range inspectStableInputs(cfg) {
if check.Name != "speakers" {
continue
}
if check.Err == nil || !strings.Contains(check.Err.Error(), "not a regular file") {
t.Fatalf("speakers check = %#v, want regular-file rejection", check)
}
return
}
t.Fatal("speakers inspection result was not reported")
}