summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-06-09 21:20:47 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-06-09 21:20:47 +0000
commit39cbed22c071aea381101a9612485118692144d0 (patch)
tree56a541327af99f9d09179b3267e76994d7183ee1 /t
parentb3fad5d69e480031e0fcd7eba8d3a926287696cc (diff)
downloadperl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar.gz
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar.bz2
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.tar.xz
perl-MDV-Distribconf-39cbed22c071aea381101a9612485118692144d0.zip
- add settree() function
Diffstat (limited to 't')
-rw-r--r--t/01distribconf.t22
1 files changed, 21 insertions, 1 deletions
diff --git a/t/01distribconf.t b/t/01distribconf.t
index 8899d40..685718b 100644
--- a/t/01distribconf.t
+++ b/t/01distribconf.t
@@ -3,7 +3,7 @@
# $Id$
use strict;
-use Test::More tests => 16;
+use Test::More tests => 22;
use_ok('MDV::Distribconf');
@@ -12,6 +12,7 @@ ok(my $dconf = MDV::Distribconf->new('/dev/null'), "Can get new MDV::Distribconf
ok(!$dconf->load(), "loading wrong distrib give error");
}
+{
ok(my $dconf = MDV::Distribconf->new('test'), "Can get new MDV::Distribconf");
ok($dconf->load(), "Can load conf");
@@ -28,4 +29,23 @@ ok($dconf->getpath(undef, 'media_info') =~ m!^/*media/media_info/?$!, "Can get m
ok($dconf->getfullpath(undef, 'media_info') =~ m!^/*test/+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!^/*test/*media/+main/?$!, "Can get media fullpath"); # vim color: */
+}
+{
+ok(my $dconf = MDV::Distribconf->new('not_exists'), "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");
+$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");
+$dconf->settree({
+ mediadir => 'mediadir',
+ infodir => 'infodir',
+});
+ok($dconf->getpath(undef, 'media_info') =~ m!^/*infodir/?$!, "Can get media_info path"); # vim color: */
+}