2
0

test4 492 B

1234567891011121314151617181920212223242526
  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(i)",\$i);
  14. for($i=0; $i<10; $i++) { $tpl->tpl_pack(1); }
  15. $tpl->tpl_dump($tmp1);
  16. `../tplxml $tmp1 > $tmp2`; # convert tpl to xml
  17. `../tplxml $tmp2 > $tmp3`; # convert xml back to tpl
  18. `diff $tmp1 $tmp3`;
  19. print "tpl files ", ($? ? "differ" : "identical"), "\n";