freeswitch/libs/libtpl-1.5/lang/perl/tests/test8
2012-09-13 15:01:01 -05:00

30 lines
536 B
Perl
Executable File

#!/usr/bin/perl
#
use strict;
use warnings;
use lib "..";
use Tpl;
my $pwd = `pwd`;
chomp $pwd;
my $tmp1 = "$pwd/$0_1.out";
my $tmp2 = "$pwd/$0_2.out";
my $tmp3 = "$pwd/$0_3.out";
my $i;
my $tpl = Tpl->tpl_map("A(s)",\$i);
for (qw(normal has&ampersand <anglebrackets>)) {
$i = $_;
$tpl->tpl_pack(1);
}
$tpl->tpl_dump($tmp1);
`../tplxml $tmp1 > $tmp2`; # convert tpl to xml
`../tplxml $tmp2 > $tmp3`; # convert xml back to tpl
`diff $tmp1 $tmp3`;
print "tpl files ", ($? ? "differ" : "identical"), "\n";