Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a test about empty configuration files
Baptiste Daroussin committed 10 years ago
commit 290a89af9fbb5534aca27a63d9b07286c4112ce6
parent 4df52ca
1 file changed +32 -1
modified tests/frontend/config.sh
@@ -2,7 +2,8 @@

. $(atf_get_srcdir)/test_environment.sh
tests_init \
-
	inline_repo
+
	inline_repo \
+
	empty_conf \

inline_repo_body() {
	cat > pkgconfiguration << EOF
@@ -15,3 +16,33 @@ EOF
		-o match:'^    url             : "file:///tmp2",$' \
		pkg -o REPOS_DIR=/dev/null -C pkgconfiguration -vv
}
+

+
empty_conf_body() {
+
	touch pkg.conf
+

+
	cat << EOF > test.ucl
+
name: test
+
origin: test
+
version: 1
+
maintainer: test
+
categories: [test]
+
comment: a test
+
www: http://test
+
prefix: /
+
desc: <<EOD
+
Yet another test
+
EOD
+
EOF
+

+
	atf_check \
+
		-e empty \
+
		-o ignore \
+
		-s exit:0 \
+
		pkg register -M test.ucl
+

+
	atf_check \
+
		-o ignore \
+
		-e empty \
+
		-s exit:0 \
+
		pkg -C pkg.conf info test
+
}