Skip to content

Commit 81d2d7c

Browse files
committed
tests: add multiline variable test for xbps-checkvers
1 parent 2b4f573 commit 81d2d7c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

tests/xbps/xbps-checkvers/checkvers_test.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,40 @@ EOF
592592
atf_check_equal "$(tr '\n' ' ' < out.sorted)" "$(tr '\n' ' ' < expected)"
593593
}
594594

595+
atf_test_case multiline_reverts
596+
597+
multiline_reverts_head() {
598+
atf_set "descr" "xbps-checkvers(1): test with reverts newline characters"
599+
}
600+
601+
multiline_reverts_body() {
602+
atf_expect_fail "multiline variables are not supported"
603+
mkdir -p some_repo pkg_A void-packages/srcpkgs/libdwarf
604+
touch pkg_A/file00
605+
cat > void-packages/srcpkgs/libdwarf/template <<EOF
606+
pkgname=libdwarf
607+
reverts="20201020_1 20200825_1 20200719_1 20200114_1 20191104_2 20191104_1
608+
20191002_1 20190529_1 20190110_1 20180809_1 20180527_1 20180129_1 20170709_2
609+
20170709_1 20170416_1 20161124_1 20161021_1 20161001_1 20160923_1 20160613_1
610+
20160507_1 20160115_1 20150507_3 20150507_2 20150507_1"
611+
version=0.11.1
612+
revision=1
613+
do_install() {
614+
:
615+
}
616+
EOF
617+
cd some_repo
618+
xbps-create -A noarch -n libdwarf-0.11.1_1 -s "A pkg" ../pkg_A
619+
atf_check_equal $? 0
620+
xbps-rindex -d -a $PWD/*.xbps
621+
atf_check_equal $? 0
622+
cd ..
623+
xbps-checkvers -R $PWD/some_repo -D $PWD/void-packages
624+
out=$(xbps-checkvers -R $PWD/some_repo -D $PWD/void-packages)
625+
atf_check_equal $? 0
626+
atf_check_equal "$out" ""
627+
}
628+
595629
atf_init_test_cases() {
596630
atf_add_test_case srcpkg_newer
597631
atf_add_test_case srcpkg_newer_with_refs
@@ -612,4 +646,5 @@ atf_init_test_cases() {
612646
atf_add_test_case subpkg
613647
atf_add_test_case removed
614648
atf_add_test_case removed_subpkgs
649+
atf_add_test_case multiline_reverts
615650
}

0 commit comments

Comments
 (0)