]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/10-good.t
Test state variables
[perl/modules/indirect.git] / t / 10-good.t
index 388f8a049d5bc915a27a8bbd67fbf5e3f8abcdf5..6559b5410a41f3ffa53fce7d106b5e78157c24e3 100644 (file)
@@ -9,15 +9,20 @@ package main;
 use strict;
 use warnings;
 
-use Test::More tests => 41 * 4;
+use Test::More tests => 53 * 4;
+
+use feature 'state';
 
 my ($obj, $pkg, $cb, $x, @a);
+our $y;
+state $z;
 sub meh;
 
 {
  local $/ = "####\n";
  while (<DATA>) {
   chomp;
+  s/\s*$//;
   local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) };
   {
    use indirect;
@@ -129,16 +134,40 @@ $obj = new
       $x
     }(qw/bar baz/);
 ####
+meh;
+####
+meh $_;
+####
 meh $x;
 ####
-meh $x, 1 , 2;
+meh $x, 1, 2;
+####
+meh $y;
+####
+meh $y, 1, 2;
+####
+meh $z;
+####
+meh $z, 1, 2;
 ####
 print;
 ####
-print STDOUT "bananananananana\n";
+print $_;
+####
+print $x;
 ####
 print $x "oh hai\n";
 ####
+print $y;
+####
+print $y "dongs\n";
+####
+print $z;
+####
+print $z "hlagh\n";
+####
+print STDOUT "bananananananana\n";
+####
 $x->foo($pkg->$cb)
 ####
 $obj = "apple ${\(new Hlagh)} pear"