Skip to content

Commit d026a7e

Browse files
docs: document language compliance test helper functions
1 parent 4accfca commit d026a7e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎tests/check-language-compliance.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ trap 'rm -rf -- "$fixture"' EXIT
88
logger="$repo_dir/check-language-compliance-log.jl"
99
log_name="$(date +%Y%m%d).log"
1010

11+
# Print all arguments as a failure message to stderr and exit the test with status 1.
1112
fail() { echo "FAIL: $*" >&2; exit 1; }
13+
14+
# Write a sample report through $logger using $1 as the state directory and
15+
# $log_name as the filename. Forward logger output and return the pipeline status.
1216
run_logger() {
1317
printf 'report\n' | julia --startup-file=no --history-file=no "$logger" "$1" "$log_name"
1418
}
19+
20+
# Assert that logging to state directory $1 fails without writing to stdout.
21+
# Capture output under $fixture; use $2 to describe the rejected case on failure.
1522
reject() {
1623
if run_logger "$1" > "$fixture/stdout" 2> "$fixture/stderr"; then
1724
fail "accepted $2"

0 commit comments

Comments
 (0)