summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/pkg_add/check-path
diff options
context:
space:
mode:
Diffstat (limited to 'regress/usr.sbin/pkg_add/check-path')
-rw-r--r--regress/usr.sbin/pkg_add/check-path12
1 files changed, 10 insertions, 2 deletions
diff --git a/regress/usr.sbin/pkg_add/check-path b/regress/usr.sbin/pkg_add/check-path
index 834bff8bd8b..2b1f0585189 100644
--- a/regress/usr.sbin/pkg_add/check-path
+++ b/regress/usr.sbin/pkg_add/check-path
@@ -1,10 +1,10 @@
#! /usr/bin/perl
-# $OpenBSD: check-path,v 1.4 2011/05/28 13:30:40 espie Exp $
+# $OpenBSD: check-path,v 1.5 2011/05/28 13:44:20 espie Exp $
# unit test the matching of extra-info and @pkgpath between packing-lists.
-use Test::Simple tests => 15;
+use Test::Simple tests => 19;
use OpenBSD::PackingList;
sub make_plist
@@ -52,6 +52,10 @@ my @p = (
make_plist('p5,f1'), # 14
make_plist('p5,f1,f3'), # 15
make_plist('p5,f1,f2,f3'), # 16
+ make_plist('newp5', 'p5,f1,f1,f2'), # 17
+ make_plist('newp5', 'p5[,f1][,f2]'), # 18
+ make_plist('newp5', 'p5[,f1,f2][,f1,f3]'), # 19
+ make_plist('newp5', 'p5[,f1,f4][,f3]'), # 20
);
ok(symetry(@p), "match_pkgpath is symetric");
@@ -69,3 +73,7 @@ ok($p[8]->match_pkgpath($p[13]), "optional parts should match");
ok($p[14]->match_pkgpath($p[13]), "optional parts should match");
ok(!$p[15]->match_pkgpath($p[13]), "detect bad parts");
ok(!$p[16]->match_pkgpath($p[13]), "detect bad parts");
+ok($p[8]->match_pkgpath($p[17]), "duplicate flavors");
+ok($p[8]->match_pkgpath($p[18]), "several optional parts");
+ok($p[16]->match_pkgpath($p[19]), "several optional parts");
+ok(!$p[20]->match_pkgpath($p[14]), "missing flavor");