diff --git a/scripts/wiki-lint-test.sh b/scripts/wiki-lint-test.sh index 7ae5a09..162d0de 100755 --- a/scripts/wiki-lint-test.sh +++ b/scripts/wiki-lint-test.sh @@ -99,13 +99,24 @@ assert_report_contains "$REPORT" "orphan" "broken-wiki orphans detected" rm -f "$REPORT" echo "" -echo "=== Test 4: real repo (sanity check, expect exit 1)===" +echo "=== Test 4: real repo (smoke-test, exit 0=clean OR 1=issues, NEVER 2)===" REPORT=$(mktemp) run_lint "$REPO_ROOT" "$REPORT" EXIT=$? -assert_exit 1 $EXIT "real-repo exit code" -assert_report_contains "$REPORT" "frontmatter" "real-repo frontmatter section" +# Smoke-test: exit 0 (clean state nach WMT-002) oder 1 (legitime Issues) ist OK. +# Nur exit 2 (Script-Crash) ist fail. +if [ "$EXIT" -eq 0 ] || [ "$EXIT" -eq 1 ]; then + echo -e "${GREEN}✓${NC} real-repo exit code (exit=$EXIT, ok: 0 or 1)" + PASS=$((PASS+1)) +else + echo -e "${RED}✗${NC} real-repo exit code (expected 0 or 1, got $EXIT — Script-Crash?)" + FAIL=$((FAIL+1)) +fi +# Section heißt jetzt "Frontmatter Präsenz" (mit Umlaut) — case-sensitive nach Umlaut suchen +assert_report_contains "$REPORT" "Frontmatter Präsenz" "real-repo frontmatter section (Schema v1.5)" assert_report_contains "$REPORT" "Stub-Quote" "real-repo stub section" +# Generische Sanity: Summary-Linie existiert (egal ob Issues oder nicht) +assert_report_contains "$REPORT" "Total Wiki-Pages:" "real-repo summary line present" rm -f "$REPORT" echo ""