secubox-deb/scripts/lib/test-helpers.sh
CyberMind-FR 4529b5c11a docs(spec): CMSD-1.0 license headers across the codebase
Brainstormed design for adding the SPDX-CMSD-1.0 header to every
first-party source file (~2,170 across 6 languages), backed by a
reusable Python tool (scripts/license-headers.py), a CI check, and
a phased per-package rollout. Spec covers scope, header rendering
per language, placement rules, tool architecture, CI integration
with an enrollment allowlist, and verification steps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 09:10:37 +02:00

33 lines
677 B
Bash

# scripts/lib/test-helpers.sh
# Sourced by test scripts. No external deps.
assert_eq() {
local expected="$1" actual="$2" msg="${3:-}"
if [[ "$expected" != "$actual" ]]; then
echo "FAIL: ${msg}"
echo " expected: $expected"
echo " actual: $actual"
return 1
fi
}
assert_contains() {
local haystack="$1" needle="$2" msg="${3:-}"
if [[ "$haystack" != *"$needle"* ]]; then
echo "FAIL: ${msg}"
echo " haystack: $haystack"
echo " needle: $needle"
return 1
fi
}
assert_file() {
local path="$1" msg="${2:-file missing}"
if [[ ! -f "$path" ]]; then
echo "FAIL: ${msg}: $path"
return 1
fi
}
pass() { echo "PASS: $*"; }