Split the unit level from the integration level in cmd, builder, link, catalogue, inventory; cheap fixtures for the archive-entry bound, the registry waits and the catalogue copy (issue 895)

This commit is contained in:
2026-10-17 21:32:23 +02:00
parent aac4bae5a4
commit 66dc501fc4
438 changed files with 22014 additions and 19825 deletions
@@ -0,0 +1,33 @@
//go:build integration
package main
import (
"strings"
"testing"
)
func TestTheArgumentsAreRequired(t *testing.T) {
for _, args := range [][]string{
{},
{"accept"},
{"accept", "anchor"},
{"accept", "anchor", "umami"},
{"give", "anchor", "umami", "database"},
} {
if err := secretCommand(t.Context(), args); err == nil {
t.Errorf("%v was accepted", args)
}
}
}
func TestTheCommandItselfSeesTheFlag(t *testing.T) {
err := secretCommand(t.Context(),
[]string{"accept", "anchor", "umami", "database", "--from", "/nonexistent/nowhere"})
if err == nil {
t.Fatal("a missing file was accepted")
}
if strings.Contains(err.Error(), "secret accept <node>") {
t.Fatalf("the command did not see its flag and complained about usage instead: %v", err)
}
}