summaryrefslogtreecommitdiff
path: root/lib/Switch
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-09-03 12:17:30 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-03 12:17:30 +0000
commit55a1c97c34bea81a888ebe7db8a5607b1b7b9a39 (patch)
treeaaa5e306ca29346cdaa4bb179b3d05ff90a6cfc4 /lib/Switch
parentefec44ca9b235a3617685a4d7c0d5b1e8d8d2fbd (diff)
downloadperl-55a1c97c34bea81a888ebe7db8a5607b1b7b9a39.tar.gz
Damian-o-rama: upgrade to Attribute::Handlers 0.75,
Filter::Simple 0.61, NEXT 0.02, Switch 2.05, and Text::Balanced 1.86. p4raw-id: //depot/perl@11842
Diffstat (limited to 'lib/Switch')
-rwxr-xr-xlib/Switch/Changes6
-rw-r--r--lib/Switch/README15
-rwxr-xr-x[-rw-r--r--]lib/Switch/t/given.t (renamed from lib/Switch/t/given_when.t)0
-rwxr-xr-xlib/Switch/t/nested.t18
-rwxr-xr-x[-rw-r--r--]lib/Switch/t/switch.t (renamed from lib/Switch/t/switch_case.t)0
5 files changed, 28 insertions, 11 deletions
diff --git a/lib/Switch/Changes b/lib/Switch/Changes
index 2f74241474..d741a69006 100755
--- a/lib/Switch/Changes
+++ b/lib/Switch/Changes
@@ -43,8 +43,8 @@ Revision history for Perl extension Switch.
- Added support for Perl 6 given..when syntax
-2.04 Mon Jul 30 13:17:35 2001
+2.05 Mon Sep 3 08:13:25 2001
- - Suppressed 'undef value' warning under -w (thanks Michael)
+ - Changed licence for inclusion in core distribution
- - Added support for Perl 6 given..when syntax
+ - Added new test file for non-fallthrough and nested switches
diff --git a/lib/Switch/README b/lib/Switch/README
index d5a7d28989..312571bbde 100644
--- a/lib/Switch/README
+++ b/lib/Switch/README
@@ -1,5 +1,5 @@
==============================================================================
- Release of version 2.04 of Switch
+ Release of version 2.05 of Switch
==============================================================================
@@ -19,20 +19,19 @@ AUTHOR
Damian Conway (damian@conway.org)
COPYRIGHT
- Copyright (c) 1997-2000, Damian Conway. All Rights Reserved. This module
- is free software. It may be used, redistributed and/or modified under
- the terms of the Perl Artistic License (see
- http://www.perl.com/perl/misc/Artistic.html)
+ Copyright (c) 1997-2001, Damian Conway. All Rights Reserved.
+ This module is free software. It may be used, redistributed
+ and/or modified under the same terms as Perl itself.
==============================================================================
-CHANGES IN VERSION 2.04
+CHANGES IN VERSION 2.05
- - Suppressed 'undef value' warning under -w (thanks Michael)
+ - Changed licence for inclusion in core distribution
- - Added support for Perl 6 given..when syntax
+ - Added new test file for non-fallthrough and nested switches
==============================================================================
diff --git a/lib/Switch/t/given_when.t b/lib/Switch/t/given.t
index 57e72de38d..57e72de38d 100644..100755
--- a/lib/Switch/t/given_when.t
+++ b/lib/Switch/t/given.t
diff --git a/lib/Switch/t/nested.t b/lib/Switch/t/nested.t
new file mode 100755
index 0000000000..032d3a6aef
--- /dev/null
+++ b/lib/Switch/t/nested.t
@@ -0,0 +1,18 @@
+use Switch;
+
+print "1..4\n";
+
+my $count = 1;
+for my $count (1..3, 'four')
+{
+ switch ([$count])
+ {
+ case qr/\d/ {
+ switch ($count) {
+ case 1 { print "ok 1\n" }
+ case [2,3] { print "ok $count\n" }
+ }
+ }
+ case 'four' { print "ok 4\n" }
+ }
+}
diff --git a/lib/Switch/t/switch_case.t b/lib/Switch/t/switch.t
index 7b147c0d9e..7b147c0d9e 100644..100755
--- a/lib/Switch/t/switch_case.t
+++ b/lib/Switch/t/switch.t