chore: import upstream snapshot with attribution
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
script_dir=$(dirname "$0")
|
||||
cd $script_dir/../testing/bats
|
||||
|
||||
ERRORS_FOUND=0
|
||||
for FILENAME_WITH_EXT in *.bats; do
|
||||
FILENAME=${FILENAME_WITH_EXT%".bats"}
|
||||
while read -r LINE; do
|
||||
if [[ ! "$LINE" =~ @test[[:space:]]+[\"\']$FILENAME: ]]; then
|
||||
TESTNAME=$(echo "$LINE" | grep -oP "(?<=@test\s)[\"\'][^\"\']+[\"\']")
|
||||
echo -e "ERROR: test \"$TESTNAME\" in \"$FILENAME_WITH_EXT\" must start with \"$FILENAME:\" in the title"
|
||||
ERRORS_FOUND=1
|
||||
fi
|
||||
done <<< $(grep '@test ['"'"'"]' "$FILENAME_WITH_EXT")
|
||||
done
|
||||
if [[ $ERRORS_FOUND -eq 1 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
Reference in New Issue
Block a user