Changeset 1905 in ProjectBuilder for devel/pb-modules/t/Conf.t
- Timestamp:
- Oct 9, 2014, 12:14:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/t/Conf.t
r1904 r1905 6 6 use ProjectBuilder::Base; 7 7 use ProjectBuilder::Conf; 8 use ProjectBuilder::Distribution; 8 9 9 10 eval … … 28 29 29 30 my $nt = 0; 30 is($path, $test->{$uri}[4], "pb_get_uri Test path $uri");31 $nt++;32 }33 31 34 32 $ENV{'TMPDIR'} = "/tmp"; … … 36 34 37 35 pb_conf_init("test"); 38 my $cf = pb_distro_conffile(); 39 my $cnt = pb_get_content($cf); 36 open(FILE,"> $ENV{'TMPDIR'}/conf.pb") || die "Unable to create $ENV{'TMPDIR'}/conf.pb"; 37 # should be in alphabetic order 38 print FILE "truc mageia-4-x86_64 = la tete a toto\n"; 39 print FILE "yorro mageia-3-x86_64 = tartampion\n"; 40 print FILE "zz mageia-3-x86_64 = yy\n"; 41 close(FILE); 42 my $cnt = pb_get_content("$ENV{'TMPDIR'}/conf.pb"); 40 43 41 my %h = pb_conf_cache($cf,\%h); 42 pb_conf_write("$PBTMP/test.pb",\%h); 43 my $content = pb_get_content("$PBTMP/test.pb"); 44 my %h; 45 my $h = \%h; 46 $h = pb_conf_cache("$ENV{'TMPDIR'}/conf.pb",$h); 47 pb_conf_write("$ENV{'TMPDIR'}/test.pb",$h); 48 my $content = pb_get_content("$ENV{'TMPDIR'}/test.pb"); 44 49 is($cnt, $content, "pb_conf_write Test"); 45 50 $nt++; 51 unlink("$ENV{'TMPDIR'}/conf.pb"); 52 unlink("$ENV{'TMPDIR'}/test.pb"); 46 53 47 54 done_testing($nt);
Note:
See TracChangeset
for help on using the changeset viewer.