testmark-bash

test-todos-files.sh

#!/bin/bash
## Checks todos.sh on several files at once, against every case in todos-files.md.
## Run with TESTMARK_REGEN=1 to update todos-files.md to match what todos.sh does now; then review the change with `git diff`.
source "$(dirname "${BASH_SOURCE[0]}")/../lib/testmark.bash"

exercise_todos_files() {
	testcase_withtmpdir
	testcase_read_myhunk mine.txt >mine.txt
	testcase_read_anyhunk shared/theirs.txt >theirs.txt
	"$TESTCASE_DIR/todos.sh" mine.txt theirs.txt | testcase_output output
}

testmarktest_rule '*/mine.txt' exercise_todos_files
testmarktest_run todos-files.md

examples/test-todos-files.sh · 582 B · 477bcbbdcb