Changeset 32 for t/01basic.t

Show
Ignore:
Timestamp:
02/16/05 18:48:28 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
1041
Message:

* Code literals -- "sub", "pointy" and "bare" variants all works
* Lexical subroutine declarations via "my sub"
* Global subroutine and variables work again, via the envGlobal pad
* The "say", "exit", "die" primitives
* Bool.perl now prints correct literals (lwall)
* Blocks under void contexts now evaluates automatically
* The "..." (dotdotdot) literal

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • t/01basic.t

    r31 r32  
    1 #!/usr/bin/perl 
     1use v6; 
    22 
    3 use FindBin; 
    4 use Config; 
    5 use File::Spec; 
     3=pod 
    64 
    7 chdir (File::Spec->catdir($FindBin::Bin, File::Spec->updir)); 
    8 my $pugs = File::Spec->catfile(File::Spec->curdir, "pugs$Config{_exe}"); 
     5This is a test file.  Whee! 
    96 
    10 system($pugs, -e => '"1..2\nok 1 # Welcome to Pugs!\n"'); 
     7=cut 
    118 
    12 open PUGS, "| $pugs" or die "Cannot pipe out to $pugs: $!"; 
    13 print PUGS << '.'; 
    14     sub cool { fine($_) ~ " # We've got " ~ toys }; 
    15     sub fine { "ok " ~ $_ }; 
    16     sub toys { "fun and games!\n" }; 
    17     cool 2 
    18 . 
    19 close PUGS; 
     9say "1..2"; 
     10say "ok 1 # Welcome to Pugs!"; 
     11 
     12sub cool { fine($_) ~ " # We've got " ~ toys } 
     13sub fine { "ok " ~ $_ } 
     14sub toys { "fun and games!" } 
     15 
     16say cool 2 # and that's it, folks!