t/cmd/subval.t See if subroutine values work
t/cmd/switch.t See if switch optimizations work
t/cmd/while.t See if while loops work
+t/comp/assertions.t See if assertions work
t/comp/bproto.t See if builtins conform to their prototypes
t/comp/cmdopt.t See if command optimization works
t/comp/colon.t See if colons are parsed correctly
t/run/runenv.t Test if perl honors its environment variables.
t/run/switcha.t Test the -a switch
t/run/switches.t Tests for the other switches
+t/run/switchA.t Test the -A switch
t/run/switchF.t Test the -F switch
t/run/switchI.t Test the -I switch
t/run/switchn.t Test the -n switch
--- /dev/null
+#!./perl
+
+my $i=1;
+print "1..10\n";
+
+sub callme ($) : assertion {
+ return shift;
+}
+
+
+# 1
+if (callme(1)) {
+ print STDERR "assertions called by default";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 2
+use assertions::activate 'mine';
+{
+ package mine;
+ sub callme ($) : assertion {
+ return shift;
+ }
+ use assertions;
+ unless (callme(1)) {
+ print STDERR "'use assertions;' doesn't active assertions based on package name";
+ print "not ";
+ }
+}
+print "ok ", $i++, "\n";
+
+# 3
+use assertions 'foo';
+if (callme(1)) {
+ print STDERR "assertion deselection doesn't work";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 4
+use assertions::activate 'bar', 'doz';
+use assertions 'bar';
+unless (callme(1)) {
+ print STDERR "assertion selection doesn't work";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 5
+use assertions '&', 'doz';
+unless (callme(1)) {
+ print STDERR "assertion activation filtering doesn't work";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 6
+use assertions '&', 'foo';
+if (callme(1)) {
+ print STDERR "assertion deactivation filtering doesn't work";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 7
+if (1) {
+ use assertions 'bar';
+}
+if (callme(1)) {
+ print STDERR "assertion scoping doesn't work";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 8
+use assertions::activate 're.*';
+use assertions 'reassert';
+unless (callme(1)) {
+ print STDERR "assertion selection with re failed";
+ print "not ";
+}
+print "ok ", $i++, "\n";
+
+# 9
+my $b=12;
+{
+ use assertions 'bar';
+ callme(my $b=45);
+ unless ($b == 45) {
+ print STDERR "this shouldn't fail ever (b=$b)";
+ print "not ";
+ }
+}
+print "ok ", $i++, "\n";
+
+# 10
+{
+ no assertions;
+ callme(my $b=46);
+ if (defined $b) {
+ print STDERR "lexical declaration in assertion arg ignored";
+ print "not ";
+ }
+}
+print "ok ", $i++, "\n";
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+ require './test.pl'; # for which_perl() etc
+}
+
+BEGIN {
+ plan(4);
+}
+
+#1
+fresh_perl_is('sub cm : assertion { "ok" }; use assertions Hello; print cm()',
+ 'ok',
+ { switches => ['-AHello'] }, '-A');
+
+#2
+fresh_perl_is('sub cm : assertion { "ok" }; use assertions SDFJKS; print cm()',
+ 'ok',
+ { switches => ['-A.*'] }, '-A.*');
+
+#3
+fresh_perl_is('sub cm : assertion { "ok" }; use assertions Bye; print cm()',
+ 'ok',
+ { switches => ['-AB.e'] }, '-AB.e');
+
+#4
+fresh_perl_is('sub cm : assertion { "ok" }; use assertions Hello; print cm()',
+ '0',
+ { switches => ['-ANoH..o'] }, '-ANoH..o');