~ubuntu-branches/ubuntu/natty/libversion-requirements-perl/natty

« back to all changes in this revision

Viewing changes to t/accepts.t

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt
  • Date: 2010-04-17 17:08:15 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100417170815-imkup6ch057f4fmj
Tags: 0.101020-1
* New upstream release.
* Add myself to Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
use Test::More 0.88;
7
7
 
8
 
# XXX: We're gonna violate us some encapsulation here and call us some private
9
 
# methods.  Y'all better just resign yourself to it.  -- rjbs, 2010-02-22
10
8
{
11
9
  my $req = Version::Requirements->new->add_minimum(Foo => 1);
12
 
  my $foo = $req->{Foo};
13
10
 
14
 
  ok($foo->_accepts(1));
15
 
  ok(! $foo->_accepts(0));
 
11
  ok(  $req->accepts_module(Foo => 1));
 
12
  ok(! $req->accepts_module(Foo => 0));
16
13
}
17
14
 
18
15
{
19
16
  my $req = Version::Requirements->new->add_maximum(Foo => 1);
20
 
  my $foo = $req->{Foo};
21
17
 
22
 
  ok($foo->_accepts(1));
23
 
  ok(! $foo->_accepts(2));
 
18
  ok(  $req->accepts_module(Foo => 1));
 
19
  ok(! $req->accepts_module(Foo => 2));
24
20
}
25
21
 
26
22
{
27
23
  my $req = Version::Requirements->new->add_exclusion(Foo => 1);
28
 
  my $foo = $req->{Foo};
29
24
 
30
 
  ok($foo->_accepts(0));
31
 
  ok(! $foo->_accepts(1));
 
25
  ok(  $req->accepts_module(Foo => 0));
 
26
  ok(! $req->accepts_module(Foo => 1));
32
27
}
33
28
 
34
29
done_testing;