diff --git a/tests/apkbuild-lint.bats b/tests/apkbuild-lint.bats index 67022f0c2c5a9b3aae8e0aaa147e05908e0d1012..e94792969b130a133fb660232d88b67452409c77 100644 --- a/tests/apkbuild-lint.bats +++ b/tests/apkbuild-lint.bats @@ -252,4 +252,61 @@ assert_match() { assert_match "${lines[0]}" "builddir.*can be removed" } +@test 'pkgname must not have uppercase characters' { + cat <<-"EOF" >$apkbuild + pkgname=foo + EOF + + run $cmd $apkbuild + [[ $status -eq 0 ]] + + cat <<-"EOF" >$apkbuild + pkgname=Foo + EOF + + run $cmd $apkbuild + [[ $status -eq 1 ]] + assert_match "${lines[0]}" "pkgname must not have uppercase characters" + + cat <<-"EOF" >$apkbuild + pkgname=fOo + EOF + + run $cmd $apkbuild + [[ $status -eq 1 ]] + assert_match "${lines[0]}" "pkgname must not have uppercase characters" + + cat <<-"EOF" >$apkbuild + pkgname=fOo + EOF + + run $cmd $apkbuild + [[ $status -eq 1 ]] + assert_match "${lines[0]}" "pkgname must not have uppercase characters" + cat <<-"EOF" >$apkbuild + pkgname=FOO + EOF + + run $cmd $apkbuild + [[ $status -eq 1 ]] + assert_match "${lines[0]}" "pkgname must not have uppercase characters" + + cat <<-"EOF" >$apkbuild + pkgname=fOO + EOF + + run $cmd $apkbuild + [[ $status -eq 1 ]] + assert_match "${lines[0]}" "pkgname must not have uppercase characters" + + cat <<-"EOF" >$apkbuild + pkgname=FoO + EOF + + run $cmd $apkbuild + [[ $status -eq 1 ]] + assert_match "${lines[0]}" "pkgname must not have uppercase characters" +} + + # vim: noexpandtab