summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2010-01-27 15:41:58 +0000
committerespie <espie@openbsd.org>2010-01-27 15:41:58 +0000
commit8f5f63b8786b9011021c9b69d3265c68a41e84a6 (patch)
tree842b94a30073f7e9d2038c4a0e829577e71b8719
parentsearch for authpf.message in $USER dirs also (diff)
downloadwireguard-openbsd-8f5f63b8786b9011021c9b69d3265c68a41e84a6.tar.xz
wireguard-openbsd-8f5f63b8786b9011021c9b69d3265c68a41e84a6.zip
more version checks
-rw-r--r--regress/usr.sbin/pkg_add/check-name21
1 files changed, 19 insertions, 2 deletions
diff --git a/regress/usr.sbin/pkg_add/check-name b/regress/usr.sbin/pkg_add/check-name
index 18ab24744b9..96b96505bc0 100644
--- a/regress/usr.sbin/pkg_add/check-name
+++ b/regress/usr.sbin/pkg_add/check-name
@@ -1,9 +1,9 @@
#! /usr/bin/perl
-# $OpenBSD: check-name,v 1.10 2010/01/24 14:12:57 espie Exp $
+# $OpenBSD: check-name,v 1.11 2010/01/27 15:41:58 espie Exp $
# Written by Marc Espie
# Public domain
-use Test::Simple tests => 19;
+use Test::Simple tests => 20;
use OpenBSD::Search;
use OpenBSD::PackageName;
@@ -41,6 +41,20 @@ sub check_name
return OpenBSD::PackageName->from_string($s)->has_issues;
}
+sub check_order
+{
+ my @l = map {OpenBSD::PackageName->from_string($_)} @_;
+ while (my $a = shift @l) {
+ for my $b (@l) {
+ if ($a->compare($b) >= 0) {
+ print $a->to_string, " > ", $b->to_string, "\n";
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
@list = qw(py-MxDateTime-2.0.1-py2.1);
ok(check_list(\@list,
check_pkgspec('py-MxDateTime->=2.0-py2.1', @list)),
@@ -104,3 +118,6 @@ ok(check_list(["flavor 1flavor can't start with digit"],
ok(check_list(["correct order is pNvM"], check_name("pkgname-1.0v0p0")),
"mixed up vp");
ok(check_list([], check_name("pkgname-1.0p0v0")), "correct name");
+
+ok(check_order(qw(speex-1.2beta3 speex-1.2rc1 speex-1.2 speex-1.2pl1
+ speex-1.3beta1)), 'check order');