summaryrefslogtreecommitdiff
path: root/t/regrec.t
blob: f50ba4440a91d866ab3090dad8339bec3aa65d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- perl -*-
use lib qw(t lib);
use strict;
use warnings;
use SlackBuild::Registry::Record;
use Test;

plan tests => 6;

my $r = new SlackBuild::Registry::Record('foo',
	                                 arch => 'x86_64',
					 version => '1.0',
					 build => 1,
					 date => 0);

ok("$r", 'foo-1.0-x86_64-1');

my $x = new SlackBuild::Registry::Record('foo',
	                                 arch => 'x86_64',
					 version => '1.0',
					 build => 2,
					 date => 0);

ok($r < $x);
ok($r <=> $x, -1);

ok($r->matches(version => { -gt => '0.2' }));
ok($r->matches(version => { -gt => '0.2' },
	       arch => { -in => [ qw(i386 x86_64)] }) );
ok(!$r->matches(version => { -gt => '0.2' },
		arch => { -eq => 'i386' }));

Return to:

Send suggestions and report system problems to the System administrator.