diff options
Diffstat (limited to 't/01distribconf.t')
-rw-r--r-- | t/01distribconf.t | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/t/01distribconf.t b/t/01distribconf.t index 685718b..5cceaec 100644 --- a/t/01distribconf.t +++ b/t/01distribconf.t @@ -3,7 +3,7 @@ # $Id$ use strict; -use Test::More tests => 22; +use Test::More tests => 28; use_ok('MDV::Distribconf'); @@ -13,7 +13,7 @@ ok(!$dconf->load(), "loading wrong distrib give error"); } { -ok(my $dconf = MDV::Distribconf->new('test'), "Can get new MDV::Distribconf"); +ok(my $dconf = MDV::Distribconf->new('test', 1), "Can get new MDV::Distribconf"); ok($dconf->load(), "Can load conf"); ok(scalar($dconf->listmedia) == 8, "Can list all media"); @@ -30,19 +30,28 @@ ok($dconf->getfullpath(undef, 'media_info') =~ m!^/*test/+media/media_info/?$!, ok($dconf->getpath('main', 'path') =~ m!^/*media/+main/?$!, "Can get media path"); # vim color: */ ok($dconf->getfullpath('main', 'path') =~ m!^/*test/*media/+main/?$!, "Can get media fullpath"); # vim color: */ } - { -ok(my $dconf = MDV::Distribconf->new('not_exists'), "Can get new MDV::Distribconf"); +ok(my $dconf = MDV::Distribconf->new('test2'), "Can get new MDV::Distribconf"); +$dconf->loadtree(); +print STDERR $dconf->getfullpath(undef, 'media_info'); +ok($dconf->getpath(undef, 'root') eq 'test2', "Can get root path"); +ok($dconf->getpath(undef, 'media_info') =~ m!^/*media/media_info/?$!, "Can get media_info path"); # vim color: */ +ok($dconf->getfullpath(undef, 'media_info') =~ m!^/*test2/+media/media_info/?$!, "Can get media_info fullpath"); # vim color: */ +ok($dconf->getpath('main', 'path') =~ m!^/*media/+main/?$!, "Can get media path"); # vim color: */ +ok($dconf->getfullpath('main', 'path') =~ m!^/*test2/*media/+main/?$!, "Can get media fullpath"); # vim color: */ +} +{ +ok(my $dconf = MDV::Distribconf->new('not_exists', 1), "Can get new MDV::Distribconf"); $dconf->settree(); ok($dconf->getpath(undef, 'media_info') =~ m!^/*media/media_info/?$!, "Can get media_info path"); # vim color: */ } { -ok(my $dconf = MDV::Distribconf->new('not_exists'), "Can get new MDV::Distribconf"); +ok(my $dconf = MDV::Distribconf->new('not_exists', 1), "Can get new MDV::Distribconf"); $dconf->settree('manDraKE'); ok($dconf->getpath(undef, 'media_info') =~ m!^/*Mandrake/base/?$!, "Can get media_info path"); # vim color: */ } { -ok(my $dconf = MDV::Distribconf->new('not_exists'), "Can get new MDV::Distribconf"); +ok(my $dconf = MDV::Distribconf->new('not_exists', 1), "Can get new MDV::Distribconf"); $dconf->settree({ mediadir => 'mediadir', infodir => 'infodir', |