Commit e574de3d authored by Leo's avatar Leo

test(apkbuild-lint): add tests for invalid-option

parent 54f12284
......@@ -986,4 +986,38 @@ retab() {
assert_match "${lines[0]}" '\[AL36\].*:FFLAGS should not be overwritten, add \$FFLAGS to it'
}
@test 'no invalid options' {
cat <<-"EOF" | retab >$apkbuild
options="net checkroot !tracedeps"
EOF
run $cmd $apkbuild
[[ $status -eq 0 ]]
}
@test 'one invalid option' {
cat <<-"EOF" | retab >$apkbuild
options="invalid"
EOF
run $cmd $apkbuild
[[ $status -eq 1 ]]
echo "output: $output"
assert_match "${lines[0]}" "\[AL49\].*:1:invalid option 'invalid'"
}
@test 'invalid option in a second assignment' {
cat <<-"EOF" | retab >$apkbuild
options="net"
options="$options invalid"
EOF
run $cmd $apkbuild
[[ $status -eq 1 ]]
echo "output: $output"
assert_match "${lines[0]}" "\[AL49\].*:2:invalid option 'invalid'"
}
# vim: noexpandtab
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment