File: 02_main.t

package info (click to toggle)
libmodule-math-depends-perl 0.02-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 176 kB
  • sloc: perl: 1,154; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (3)
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
32
33
34
35
36
37
38
#!/usr/bin/perl

# Main tests for Module::Math::Depends

use strict;
BEGIN {
	$|  = 1;
	$^W = 1;
}

use Test::More tests => 7;
use Module::Math::Depends;
use constant MMD => 'Module::Math::Depends';





#####################################################################
# Basic Testing

SCOPE: {
	my $empty = MMD->new;
	isa_ok( $empty, MMD );
	is( scalar(keys %$empty), 0, '->new makes an empty set' );
}

SCOPE: {
	my $deps = MMD->from_hash( {
		Foo => 1,
		Bar => 0,
		} );
	isa_ok( $deps, MMD );
	is( scalar(keys %$deps), 2, '->from_hash works' );
	isa_ok( $deps->{Foo}, 'version' );
	isa_ok( $deps->{Bar}, 'version' );
	is( $deps->{Foo}->numify, '1.000', 'Foo has ok dep' );
}