test8 536 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/perl
  2. #
  3. use strict;
  4. use warnings;
  5. use lib "..";
  6. use Tpl;
  7. my $pwd = `pwd`;
  8. chomp $pwd;
  9. my $tmp1 = "$pwd/$0_1.out";
  10. my $tmp2 = "$pwd/$0_2.out";
  11. my $tmp3 = "$pwd/$0_3.out";
  12. my $i;
  13. my $tpl = Tpl->tpl_map("A(s)",\$i);
  14. for (qw(normal has&ampersand <anglebrackets>)) {
  15. $i = $_;
  16. $tpl->tpl_pack(1);
  17. }
  18. $tpl->tpl_dump($tmp1);
  19. `../tplxml $tmp1 > $tmp2`; # convert tpl to xml
  20. `../tplxml $tmp2 > $tmp3`; # convert xml back to tpl
  21. `diff $tmp1 $tmp3`;
  22. print "tpl files ", ($? ? "differ" : "identical"), "\n";