]> git.vpit.fr Git - perl/modules/Variable-Temp.git/commitdiff
Merge t/10-lexical.t and t/11-global.t into t/10-base.t
authorVincent Pit <vince@profvince.com>
Fri, 13 Mar 2015 18:57:40 +0000 (15:57 -0300)
committerVincent Pit <vince@profvince.com>
Fri, 13 Mar 2015 19:00:27 +0000 (16:00 -0300)
MANIFEST
t/10-base.t [new file with mode: 0644]
t/10-lexical.t [deleted file]
t/11-global.t [deleted file]

index 76041cc8701d4af2a9cf7fede80cd000a4bd61f2..d6ffc1eb3be6cf3753e6429e9b20ebfea25d5752 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -7,8 +7,7 @@ README
 lib/Variable/Temp.pm
 t/00-load.t
 t/01-import.t
 lib/Variable/Temp.pm
 t/00-load.t
 t/01-import.t
-t/10-lexical.t
-t/11-global.t
+t/10-base.t
 t/12-destroy.t
 t/13-magic.t
 t/15-lvalue-sub.t
 t/12-destroy.t
 t/13-magic.t
 t/15-lvalue-sub.t
diff --git a/t/10-base.t b/t/10-base.t
new file mode 100644 (file)
index 0000000..57ea47f
--- /dev/null
@@ -0,0 +1,59 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Variable::Temp 'set_temp';
+
+use Test::More tests => 7 + 13;
+
+my $x = 1;
+is $x, 1;
+{
+ set_temp $x => 2;
+ is $x, 2;
+ $x = 3;
+ is $x, 3;
+ {
+  set_temp $x => 4;
+  is $x, 4;
+  set_temp $x => 5;
+  is $x, 5;
+ }
+ is $x, 3;
+}
+is $x, 1;
+
+our $y = 1;
+is $y, 1;
+{
+ set_temp $y => 2;
+ is $y, 2;
+ $y = 3;
+ is $y, 3;
+ {
+  set_temp $y => 4;
+  is $y, 4;
+  set_temp $y => 5;
+  is $y, 5;
+ }
+ is $y, 3;
+ {
+  local $y = 6;
+  is $y, 6;
+ }
+ is $y, 3;
+ {
+  local $y = 7;
+  set_temp $y => 8;
+  is $y, 8;
+ }
+ is $y, 3;
+ {
+  set_temp $y => 9;
+  local $y = 10;
+  is $y, 10;
+ }
+ is $y, 3;
+}
+is $y, 1;
diff --git a/t/10-lexical.t b/t/10-lexical.t
deleted file mode 100644 (file)
index 8fc07fa..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!perl -T
-
-use strict;
-use warnings;
-
-use Variable::Temp 'set_temp';
-
-use Test::More tests => 7;
-
-my $x = 1;
-is $x, 1;
-{
- set_temp $x => 2;
- is $x, 2;
- $x = 3;
- is $x, 3;
- {
-  set_temp $x => 4;
-  is $x, 4;
-  set_temp $x => 5;
-  is $x, 5;
- }
- is $x, 3;
-}
-is $x, 1;
diff --git a/t/11-global.t b/t/11-global.t
deleted file mode 100644 (file)
index 99a40f5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!perl -T
-
-use strict;
-use warnings;
-
-use Variable::Temp 'set_temp';
-
-use Test::More tests => 13;
-
-our $x = 1;
-is $x, 1;
-{
- set_temp $x => 2;
- is $x, 2;
- $x = 3;
- is $x, 3;
- {
-  set_temp $x => 4;
-  is $x, 4;
-  set_temp $x => 5;
-  is $x, 5;
- }
- is $x, 3;
- {
-  local $x = 6;
-  is $x, 6;
- }
- is $x, 3;
- {
-  local $x = 7;
-  set_temp $x => 8;
-  is $x, 8;
- }
- is $x, 3;
- {
-  set_temp $x => 9;
-  local $x = 10;
-  is $x, 10;
- }
- is $x, 3;
-}
-is $x, 1;