Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
tests: add a test for regression in #1995
Franco Fichtner committed 4 years ago
commit f95ea9436c98c8e4488c64350d0a0dd1389c1d0f
parent 373c4f7
1 file changed +25 -4
modified tests/frontend/add.sh
@@ -12,6 +12,7 @@ tests_init \
		add_stdin \
		add_stdin_missing \
		add_no_version \
+
		add_no_version_multi \
		add_wrong_version

initialize_pkg() {
@@ -213,8 +214,7 @@ post-install
}

add_no_version_body() {
-

-
	for p in test test-lib final ; do
+
	for p in test final ; do
		atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg ${p} ${p} 1
		if [ ${p} = "final" ]; then
			cat << EOF >> final.ucl
@@ -232,9 +232,30 @@ EOF
		pkg add final-1.pkg
}

-
add_wrong_version_body() {
+
add_no_version_multi_body() {
+
	for p in test final ; do
+
		atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg ${p} ${p} 1
+
		if [ ${p} = "final" ]; then
+
			cat << EOF >> final.ucl
+
deps {
+
	test {
+
		origin = "test";
+
	},
+
	pkgnotfound {
+
		origin = "pkgnotfound";
+
	}
+
}
+
EOF
+
		fi
+
		atf_check -o ignore -s exit:0 \
+
			pkg create -M ${p}.ucl
+
	done
+
	atf_check -o ignore -e ignore -s exit:1 \
+
		pkg add final-1.pkg
+
}

-
	for p in test test-lib final ; do
+
add_wrong_version_body() {
+
	for p in test final ; do
		atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg ${p} ${p} 1
		if [ ${p} = "final" ]; then
			cat << EOF >> final.ucl