Tests: no hint where a reference would mean something else, and every reference the help advertises resolves

This commit is contained in:
2026-09-03 21:11:11 +02:00
parent 1cd422352b
commit 8ed8d9bb51
2 changed files with 20 additions and 6 deletions
+10
View File
@@ -4,6 +4,7 @@ import (
"bytes"
"os"
"path/filepath"
"regexp"
"strings"
"testing"
)
@@ -333,6 +334,15 @@ func TestClassify(t *testing.T) {
}
}
func TestUsageReferencesResolve(t *testing.T) {
for _, token := range regexp.MustCompile(`\{/[^}]+\}`).FindAllString(usage, -1) {
code, out, errb := runOut("--seed", "1", token)
if code != 0 || strings.TrimSpace(out) == "" {
t.Errorf("usage advertises %s: run = %d, %q, stderr %q", token, code, out, errb)
}
}
}
func TestRunShapeMisuseBeforeLoad(t *testing.T) {
code, _, errb := runOut("--no-shipped-data", "[abc]")
if code != 2 || !strings.Contains(errb, "[abc]") || strings.Contains(errb, "--data-path") {