cvsuser     02/10/18 14:19:52

  Modified:    t/op     macro.t
  Log:
  Patch 17899 from Simon Glover
  
    4) Adds two tests for .include to macro.t
  
  Revision  Changes    Path
  1.11      +53 -1     parrot/t/op/macro.t
  
  Index: macro.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/op/macro.t,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -w -r1.10 -r1.11
  --- macro.t   10 Jun 2002 04:29:25 -0000      1.10
  +++ macro.t   18 Oct 2002 21:19:52 -0000      1.11
  @@ -1,6 +1,6 @@
   #! perl -w
   
  -use Parrot::Test tests => 13;
  +use Parrot::Test tests => 15;
   use Test::More;
   
   output_is( <<'CODE', <<OUTPUT, "macro, zero parameters" );
  @@ -147,3 +147,55 @@
     .answer(.FOO)
     end
   CODE
  +
  +open FOO, ">macro.tempfile";
  +print FOO <<'ENDF';
  +  set S0, "Betelgeuse\n"
  +ENDF
  +close FOO;
  +
  +output_is(<<"CODE", <<OUTPUT, "basic include macro");
  +.include "macro.tempfile"
  +  print S0
  +
  +  set S0, "Rigel"
  +.include "macro.tempfile"
  +  print S0
  +  end
  +CODE
  +Betelgeuse
  +Betelgeuse
  +OUTPUT
  +
  +
  +open FOO, ">macro.tempfile";   # Clobber previous
  +print FOO <<'ENDF';
  +  .macro multiply(A,B) 
  +    new P0, .PerlNum
  +    set P0, .A
  +    new P1, .PerlNum
  +    set P1, .B
  +    new P2, .PerlNum
  +    mul P2, P1, P0
  +  .endm
  +ENDF
  +close FOO;
  +
  +output_is(<<"CODE", <<OUTPUT, "include a file defining a macro");
  +.include "macro.tempfile"
  +  .multiply(12,13)
  +  print P2
  +  print "\\n"
  +  end
  +CODE
  +156
  +OUTPUT
  +
  +open FOO, ">macro.tempfile";   # Clobber previous
  +close FOO;
  +unlink("macro.tempfile");
  +1;
  +
  +
  +
  +
  
  
  


Reply via email to