]> 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 708397f73a9cd44126c4532acfd8af1b1edd1147..6559b5410a41f3ffa53fce7d106b5e78157c24e3 100644 (file)
@@ -9,10 +9,13 @@ package main;
 use strict;
 use warnings;
 
-use Test::More tests => 49 * 4;
+use Test::More tests => 53 * 4;
+
+use feature 'state';
 
 my ($obj, $pkg, $cb, $x, @a);
 our $y;
+state $z;
 sub meh;
 
 {
@@ -143,6 +146,10 @@ meh $y;
 ####
 meh $y, 1, 2;
 ####
+meh $z;
+####
+meh $z, 1, 2;
+####
 print;
 ####
 print $_;
@@ -155,6 +162,10 @@ print $y;
 ####
 print $y "dongs\n";
 ####
+print $z;
+####
+print $z "hlagh\n";
+####
 print STDOUT "bananananananana\n";
 ####
 $x->foo($pkg->$cb)