diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-01-27 15:41:59 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-01-27 15:41:59 +0000 |
commit | 690d69ec132018763537ba7567b114b76a2d1f6e (patch) | |
tree | 9492fbb212fd4f6a59a6ab5f11100e8579f4d1da /regress/usr.sbin | |
parent | ddde5d013891dab89d5768f3f204ad9e1ca607ee (diff) |
more version checks
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r-- | regress/usr.sbin/pkg_add/check-name | 21 |
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'); |