Debian-Apt-PM

 view release on metacpan or  search on metacpan

t/01_Debian-Apt-PM.t  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;

#use Test::More 'no_plan';
use Test::More tests => 12;
use Test::Differences;
use Test::Exception;

use FindBin qw($Bin);
use lib "$Bin/lib";

BEGIN {
	use_ok ( 'Debian::Apt::PM' ) or exit;
}

exit main();

sub main {
	INTERNAL_parse_perl_modules: {
		my $t1 = " MM (0.001001)\n";
		my $t2 = " \n M1 (1)\n M3 (3)\n M2 (2)\n";
		my $t3 = " \n BackupManager::Dialog (0)\n BackupManager::Config (0)\n BackupManager::Logger (0)\n";
		
		is_deeply(
			{ Debian::Apt::PM::_parse_perl_modules($t1) },
			{ 'MM' => '0.001001' },
			'parsing Perl-Modules'
		);
		
		is_deeply(
			{ Debian::Apt::PM::_parse_perl_modules($t2) },
			{
				'M1' => '1',
				'M2' => '2',
				'M3' => '3',
			},
			'parsing Perl-Modules'
		);

		is_deeply(
			{ Debian::Apt::PM::_parse_perl_modules($t3) },
			{
				'BackupManager::Dialog' => '0',
				'BackupManager::Config' => '0',
				'BackupManager::Logger' => '0',
			},
			'parsing Perl-Modules'
		);
	}
	
	INTERNAL_modules_index: {
		my $aptpm = Debian::Apt::PM->new(sources => [ File::Spec->catfile($Bin, 'PerlPackages.bz2') ]);
		
		my %deb1 = (
			'version'      => '5.230-1',
			'package'      => 'libanyevent-perl',
			'arch'         => 'all',
			'distribution' => 'testing',
			'component'    => 'main',
		);
		my %deb2 = (
			'version'      => '0.21-1',
			'package'      => 'libclass-c3-perl',
			'arch'         => 'all',
			'distribution' => 'testing',
			'component'    => 'main',



( run in 0.752 second using v1.01-cache-2.11-cpan-b16cb0d3907 )