Changeset 2493 in ProjectBuilder


Ignore:
Timestamp:
Mar 31, 2020, 12:55:32 PM (4 years ago)
Author:
Bruno Cornec
Message:

more tests for conf with YAML::XS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/t/Conf.t

    r2278 r2493  
    3939
    4040pb_conf_init("test");
    41 open(FILE,"> $ENV{'TMPDIR'}/conf.pb") || die "Unable to create $ENV{'TMPDIR'}/conf.pb";
     41open(FILE,"> $ENV{'TMPDIR'}/conf.yml") || die "Unable to create $ENV{'TMPDIR'}/conf.yml";
    4242if ($projectbuilderconfver < 1) {
    4343    # Old conf file format
    4444    # should be in alphabetic order
    45     print FILE "truc mageia-4-x86_64 = la tete a toto\n";
     45    print FILE "colon mageia-3-x86_64 = ex: test\n";
     46    print FILE "percent mageia-3-x86_64 = %check\n";
     47    print FILE "truc mageia-4-x86_64 = la tete à toto\n";
    4648    print FILE "yorro mageia-3-x86_64 = tartampion\n";
    47     print FILE "zz mageia-3-x86_64 = yy\n";
     49    print FILE "zz mageia-3-x86_64 =\n";
    4850} else {
    4951    print FILE "---\n";
     52    print FILE "colon:\n";
     53    print FILE "  mageia-3-x86_64: 'ex: test'\n";
     54    print FILE "percent:\n";
     55    print FILE "  mageia-3-x86_64: '%check'\n";
    5056    print FILE "truc:\n";
    51     print FILE "  mageia-4-x86_64: la tete a toto\n";
     57    print FILE "  mageia-4-x86_64: la tete à toto\n";
    5258    print FILE "yorro:\n";
    5359    print FILE "  mageia-3-x86_64: tartampion\n";
     
    5662}
    5763close(FILE);
    58 my $cnt = pb_get_content("$ENV{'TMPDIR'}/conf.pb");
     64my $cnt = pb_get_content("$ENV{'TMPDIR'}/conf.yml");
    5965
    6066my %h;
    6167my $h = \%h;
    62 $h = pb_conf_cache("$ENV{'TMPDIR'}/conf.pb",$h);
    63 pb_conf_write("$ENV{'TMPDIR'}/test.pb",$h);
    64 my $content = pb_get_content("$ENV{'TMPDIR'}/test.pb");
     68$h = pb_conf_cache("$ENV{'TMPDIR'}/conf.yml",$h);
     69pb_conf_write("$ENV{'TMPDIR'}/test.yml",$h);
     70my $content = pb_get_content("$ENV{'TMPDIR'}/test.yml");
    6571is($cnt, $content, "pb_conf_write Test");
    6672$nt++;
    67 unlink("$ENV{'TMPDIR'}/conf.pb");
    68 unlink("$ENV{'TMPDIR'}/test.pb");
     73#unlink("$ENV{'TMPDIR'}/conf.yml");
     74#unlink("$ENV{'TMPDIR'}/test.yml");
    6975
    7076done_testing($nt);
Note: See TracChangeset for help on using the changeset viewer.