4 if( $ENV{PERL_CORE} ) {
9 unless ($Config{usedl}) {
10 print "1..0 # no usedl, skipping\n";
17 use ExtUtils::MakeMaker;
18 use ExtUtils::Constant qw (C_constant autoload);
22 my $do_utf_tests = $] > 5.006;
23 my $better_than_56 = $] > 5.007;
24 # For debugging set this to 1.
28 # Because were are going to be changing directory before running Makefile.PL
30 # 5.005 doesn't have new enough File::Spec to have rel2abs. But actually we
31 # only need it when $^X isn't absolute, which is going to be 5.8.0 or later
32 # (where ExtUtils::Constant is in the core, and tests against the uninstalled
34 $perl = File::Spec->rel2abs ($perl) unless $] < 5.006;
35 # ExtUtils::Constant::C_constant uses $^X inside a comment, and we want to
36 # compare output to ensure that it is the same. We were probably run as ./perl
37 # whereas we will run the child with the full path in $perl. So make $^X for
38 # us the same as our child will see.
40 my $lib = $ENV{PERL_CORE} ? '../../../lib' : '../../blib/lib';
41 my $runperl = "$perl \"-I$lib\"";
42 print "# perl=$perl\n";
44 my $make = $Config{make};
45 $make = $ENV{MAKE} if exists $ENV{MAKE};
46 if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; }
48 # VMS may be using something other than MMS/MMK
51 $mms_or_mmk = 1 if (($make eq 'MMK') || ($make eq 'MMS'));
54 # Renamed by make clean
55 my $makefile = ($mms_or_mmk ? 'descrip' : 'Makefile');
56 my $makefile_ext = ($mms_or_mmk ? '.mms' : '');
57 my $makefile_rename = $makefile . ($mms_or_mmk ? '.mms_old' : '.old');
59 my $output = "output";
60 my $package = "ExtTest";
63 # The real test counter.
67 my $updir = File::Spec->updir;
68 die "Can't get current directory: $!" unless defined $orig_cwd;
70 print "# $dir being created...\n";
71 mkdir $dir, 0777 or die "mkdir: $!\n";
74 if (defined $orig_cwd and length $orig_cwd) {
75 chdir $orig_cwd or die "Can't chdir back to '$orig_cwd': $!";
77 print "# $dir being removed...\n";
78 rmtree($dir) unless $keep_files;
81 die "cwd at start was empty, but directory '$dir' was created" if $dir;
86 push @INC, '../../lib', '../../../lib';
92 bless(\( my $ref = ''), $class);
97 $$self .= join('', @_);
102 $$self .= sprintf shift, @_;
107 return substr($$self, 0, length($$self), '');
112 sub check_for_bonus_files {
114 my %expect = map {($^O eq 'VMS' ? lc($_) : $_), 1} @_;
117 opendir DIR, $dir or die "opendir '$dir': $!";
118 while (defined (my $entry = readdir DIR)) {
119 $entry =~ s/\.$// if $^O eq 'VMS'; # delete trailing dot that indicates no extension
120 next if $expect{$entry};
121 print "# Extra file '$entry'\n";
125 closedir DIR or warn "closedir '.': $!";
127 print "not ok $realtest\n";
129 print "ok $realtest\n";
135 my ($tests, $expect, $files) = @_;
136 my $core = $ENV{PERL_CORE} ? ' PERL_CORE=1' : '';
137 my @perlout = `$runperl Makefile.PL $core`;
139 print "not ok $realtest # $runperl Makefile.PL failed: $?\n";
140 print "# $_" foreach @perlout;
143 print "ok $realtest\n";
147 if (-f "$makefile$makefile_ext") {
148 print "ok $realtest\n";
150 print "not ok $realtest\n";
156 if ($^O eq 'VMS') { $make .= ' all'; }
158 # Sometimes it seems that timestamps can get confused
161 # Makefile out-of-date with respect to Makefile.PL
162 # Cleaning current config before rebuilding Makefile...
163 # make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
164 # ../../perl "-I../../../lib" "-I../../../lib" Makefile.PL "PERL_CORE=1"
165 # Checking if your kit is complete...
167 # Writing Makefile for ExtTest
168 # ==> Your Makefile has been rebuilt. <==
169 # ==> Please rerun the make command. <==
172 my $timewarp = (-M "Makefile.PL") - (-M "$makefile$makefile_ext");
173 # Convert from days to seconds
175 print "# Makefile.PL is $timewarp second(s) older than $makefile$makefile_ext\n";
177 # Sleep for a while to catch up.
178 $timewarp = -$timewarp;
180 $timewarp = 10 if $timewarp > 10;
181 print "# Sleeping for $timewarp second(s) to try to resolve this\n";
185 print "# make = '$make'\n";
188 print "not ok $realtest # $make failed: $?\n";
189 print "# $_" foreach @makeout;
192 print "ok $realtest\n";
196 if ($^O eq 'VMS') { $make =~ s{ all}{}; }
198 if ($Config{usedl}) {
199 print "ok $realtest # This is dynamic linking, so no need to make perl\n";
201 my $makeperl = "$make perl";
202 print "# make = '$makeperl'\n";
203 @makeout = `$makeperl`;
205 print "not ok $realtest # $makeperl failed: $?\n";
206 print "# $_" foreach @makeout;
209 print "ok $realtest\n";
214 my $maketest = "$make test";
215 print "# make = '$maketest'\n";
217 @makeout = `$maketest`;
219 if (open OUTPUT, "<$output") {
220 local $/; # Slurp it - faster.
222 close OUTPUT or print "# Close $output failed: $!\n";
224 # Harness will report missing test results at this point.
225 print "# Open <$output failed: $!\n";
230 print "not ok $realtest # $maketest failed: $?\n";
231 print "# $_" foreach @makeout;
233 print "ok $realtest - maketest\n";
237 if (defined $expect) {
238 # -x is busted on Win32 < 5.6.1, so we emulate it.
240 if( $^O eq 'MSWin32' && $] <= 5.006001 ) {
241 open(REGENTMP, ">regentmp") or die $!;
242 open(XS, "$package.xs") or die $!;
245 $saw_shebang++ if /^#!.*/i ;
246 print REGENTMP $_ if $saw_shebang;
248 close XS; close REGENTMP;
249 $regen = `$runperl regentmp`;
253 $regen = `$runperl -x $package.xs`;
256 print "not ok $realtest # $runperl -x $package.xs failed: $?\n";
258 print "ok $realtest - regen\n";
262 if ($expect eq $regen) {
263 print "ok $realtest - regen worked\n";
265 print "not ok $realtest - regen worked\n";
266 # open FOO, ">expect"; print FOO $expect;
267 # open FOO, ">regen"; print FOO $regen; close FOO;
272 print "ok $realtest # skip no regen or expect for this set of tests\n";
277 my $makeclean = "$make clean";
278 print "# make = '$makeclean'\n";
279 @makeout = `$makeclean`;
281 print "not ok $realtest # $make failed: $?\n";
282 print "# $_" foreach @makeout;
284 print "ok $realtest\n";
288 check_for_bonus_files ('.', @$files, $output, $makefile_rename, '.', '..');
290 rename $makefile_rename, $makefile . $makefile_ext
291 or die "Can't rename '$makefile_rename' to '$makefile$makefile_ext': $!";
293 unlink $output or warn "Can't unlink '$output': $!";
295 # Need to make distclean to remove ../../lib/ExtTest.pm
296 my $makedistclean = "$make distclean";
297 print "# make = '$makedistclean'\n";
298 @makeout = `$makedistclean`;
300 print "not ok $realtest # $make failed: $?\n";
301 print "# $_" foreach @makeout;
303 print "ok $realtest\n";
307 check_for_bonus_files ('.', @$files, '.', '..');
309 unless ($keep_files) {
311 unlink $_ or warn "unlink $_: $!";
315 check_for_bonus_files ('.', '.', '..');
320 ################ Makefile.PL
321 # We really need a Makefile.PL because make test for a no dynamic linking perl
322 # will run Makefile.PL again as part of the "make perl" target.
323 my $makefilePL = "Makefile.PL";
324 open FH, ">$makefilePL" or die "open >$makefilePL: $!\n";
327 use ExtUtils::MakeMaker;
329 'NAME' => "$package",
330 'VERSION_FROM' => "$package.pm", # finds \$VERSION
332 (#ABSTRACT_FROM => "$package.pm", # XXX add this
333 AUTHOR => "$0") : ())
337 close FH or die "close $makefilePL: $!\n";
343 ################ MANIFEST
344 # We really need a MANIFEST because make distclean checks it.
345 my $manifest = "MANIFEST";
346 push @files, $manifest;
347 open FH, ">$manifest" or die "open >$manifest: $!\n";
348 print FH "$_\n" foreach @files;
349 close FH or die "close $manifest: $!\n";
353 sub write_and_run_extension {
354 my ($name, $items, $export_names, $package, $header, $testfile, $num_tests,
357 my $c = tie *C, 'TieOut';
358 my $xs = tie *XS, 'TieOut';
360 ExtUtils::Constant::WriteConstants(C_FH => \*C,
367 my $C_code = $c->read();
368 my $XS_code = $xs->read();
376 # Don't check the regeneration code if we specify extra arguments to
377 # WriteConstants. (Fix this to give finer grained control if needed)
379 $expect = $C_code . "\n#### XS Section:\n" . $XS_code unless $wc_args;
381 print "# $name\n# $dir/$subdir being created...\n";
382 mkdir $subdir, 0777 or die "mkdir: $!\n";
383 chdir $subdir or die $!;
387 ################ Header
388 my $header_name = "test.h";
389 push @files, $header_name;
390 open FH, ">$header_name" or die "open >$header_name: $!\n";
391 print FH $header or die $!;
392 close FH or die "close $header_name: $!\n";
395 my $xs_name = "$package.xs";
396 push @files, $xs_name;
397 open FH, ">$xs_name" or die "open >$xs_name: $!\n";
403 #include "$header_name"
407 MODULE = $package PACKAGE = $package
412 close FH or die "close $xs: $!\n";
415 my $pm = "$package.pm";
417 open FH, ">$pm" or die "open >$pm: $!\n";
418 print FH "package $package;\n";
419 print FH "use $];\n";
425 printf FH "use warnings;\n" unless $] < 5.006;
431 use vars qw ($VERSION @ISA @EXPORT_OK $AUTOLOAD);
434 @ISA = qw(Exporter DynaLoader);
436 # Having this qw( in the here doc confuses cperl mode far too much to be
437 # helpful. And I'm using cperl mode to edit this, even if you're not :-)
438 print FH "\@EXPORT_OK = qw(\n";
440 # Print the names of all our autoloaded constants
441 print FH "\t$_\n" foreach (@$export_names);
443 # Print the AUTOLOAD subroutine ExtUtils::Constant generated for us
444 print FH autoload ($package, $]);
445 print FH "bootstrap $package \$VERSION;\n1;\n__END__\n";
446 close FH or die "close $pm: $!\n";
448 ################ test.pl
449 my $testpl = "test.pl";
450 push @files, $testpl;
451 open FH, ">$testpl" or die "open >$testpl: $!\n";
452 # Standard test header (need an option to suppress this?)
453 print FH <<"EOT" or die $!;
455 use $package qw(@$export_names);
458 if (open OUTPUT, ">$output") {
462 print "not ok 1 # Failed to open '$output': \$!\n";
466 print FH $testfile or die $!;
467 print FH <<"EOT" or die $!;
472 print "not ok 2 # Failed to close '$output': \$!\n";
475 close FH or die "close $testpl: $!\n";
477 push @files, Makefile_PL($package);
478 @files = MANIFEST (@files);
480 build_and_run ($num_tests, $expect, \@files);
482 chdir $updir or die "chdir '$updir': $!";
486 # Tests are arrayrefs of the form
487 # $name, [items], [export_names], $package, $header, $testfile, $num_tests
489 my $before_tests = 4; # Number of "ok"s emitted to build extension
490 my $after_tests = 8; # Number of "ok"s emitted after make test run
495 $dummytest += $before_tests;
499 my ($name, $items, $export_names, $header, $testfile, $args) = @_;
500 push @tests, [$name, $items, $export_names, $package, $header, $testfile,
501 $dummytest - $here, $args];
502 $dummytest += $after_tests;
506 if (ord('A') == 193) { # EBCDIC platform
507 $pound = chr 177; # A pound sign. (Currency)
508 } else { # ASCII platform
509 $pound = chr 163; # A pound sign. (Currency)
512 {name=>"perl", type=>"PV",},
513 {name=>"*/", type=>"PV", value=>'"CLOSE"', macro=>1},
514 {name=>"/*", type=>"PV", value=>'"OPEN"', macro=>1},
515 {name=>$pound, type=>"PV", value=>'"Sterling"', macro=>1},
519 push @args, [PROXYSUBS => 1] if $] > 5.009002;
520 foreach my $args (@args)
525 'A Standard for the Transmission of IP Datagrams on Avian Carriers';
526 # Test the code that generates 1 and 2 letter name comparisons.
528 N => 0, 'NE' => 45, E => 90, SE => 135,
529 S => 180, SW => 225, W => 270, NW => 315
532 my $header = << "EOT";
534 #define OK6 "ok 6\\n"
536 #define FARTHING 0.25
541 #define RFC1149 "$parent_rfc1149"
546 while (my ($point, $bearing) = each %compass) {
547 $header .= "#define $point $bearing\n"
550 my @items = ("FIVE", {name=>"OK6", type=>"PV",},
551 {name=>"OK7", type=>"PVN",
552 value=>['"not ok 7\\n\\0ok 7\\n"', 15]},
553 {name => "FARTHING", type=>"NV"},
554 {name => "NOT_ZERO", type=>"UV", value=>"~(UV)0"},
555 {name => "OPEN", type=>"PV", value=>'"/*"', macro=>1},
556 {name => "CLOSE", type=>"PV", value=>'"*/"',
557 macro=>["#if 1\n", "#endif\n"]},
558 {name => "ANSWER", default=>["UV", 42]}, "NOTDEF",
559 {name => "Yes", type=>"YES"},
560 {name => "No", type=>"NO"},
561 {name => "Undef", type=>"UNDEF"},
562 # OK. It wasn't really designed to allow the creation of dual valued
564 # It was more for INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK INADDR_NONE
565 {name=>"RFC1149", type=>"SV", value=>"sv_2mortal(temp_sv)",
566 pre=>"SV *temp_sv = newSVpv(RFC1149, 0); "
567 . "(void) SvUPGRADE(temp_sv,SVt_PVIV); SvIOK_on(temp_sv); "
568 . "SvIV_set(temp_sv, 1149);"},
571 push @items, $_ foreach keys %compass;
573 # Automatically compile the list of all the macro names, and make them
574 # exported constants.
575 my @export_names = map {(ref $_) ? $_->{name} : $_} @items;
577 # Exporter::Heavy (currently) isn't able to export the last 3 of these:
578 push @items, @common_items;
580 my $test_body = <<"EOT";
582 my \$test = $dummytest;
586 $test_body .= <<'EOT';
587 # What follows goes to the temporary file.
593 print "not ok $test # \$five\n";
598 if (OK6 eq "ok 6\n") {
601 print "not ok $test # \$five\n";
605 # PVN containing embedded \0s
613 my $farthing = FARTHING;
614 if ($farthing == 0.25) {
617 print "not ok $test # $farthing\n";
622 my $not_zero = NOT_ZERO;
623 if ($not_zero > 0 && $not_zero == ~0) {
626 print "not ok $test # \$not_zero=$not_zero ~0=" . (~0) . "\n";
630 # Value includes a "*/" in an attempt to bust out of a C comment.
631 # Also tests custom cpp #if clauses
633 if ($close eq '*/') {
636 print "not ok $test # \$close='$close'\n";
640 # Default values if macro not defined.
645 print "not ok $test # What do you get if you multiply six by nine? '$answer'\n";
650 my $notdef = eval { NOTDEF; };
651 if (defined $notdef) {
652 print "not ok $test # \$notdef='$notdef'\n";
653 } elsif ($@ !~ /Your vendor has not defined ExtTest macro NOTDEF/) {
654 print "not ok $test # \$@='$@'\n";
661 my $notthere = eval { &ExtTest::NOTTHERE; };
662 if (defined $notthere) {
663 print "not ok $test # \$notthere='$notthere'\n";
664 } elsif ($@ !~ /NOTTHERE is not a valid ExtTest macro/) {
666 print "not ok $test # \$@='$@'\n";
677 print "not ok $test # $yes='\$yes'\n";
683 if (defined $no and !$no) {
686 print "not ok $test # \$no=" . defined ($no) ? "'$no'\n" : "undef\n";
692 unless (defined $undef) {
695 print "not ok $test # \$undef='$undef'\n";
699 # invalid macro (chosen to look like a mix up between No and SW)
700 $notdef = eval { &ExtTest::So };
701 if (defined $notdef) {
702 print "not ok $test # \$notdef='$notdef'\n";
703 } elsif ($@ !~ /^So is not a valid ExtTest macro/) {
704 print "not ok $test # \$@='$@'\n";
710 # invalid defined macro
711 $notdef = eval { &ExtTest::EW };
712 if (defined $notdef) {
713 print "not ok $test # \$notdef='$notdef'\n";
714 } elsif ($@ !~ /^EW is not a valid ExtTest macro/) {
715 print "not ok $test # \$@='$@'\n";
724 while (my ($point, $bearing) = each %compass) {
725 $test_body .= "'$point' => $bearing, "
728 $test_body .= <<'EOT';
733 while (my ($point, $bearing) = each %compass) {
734 my $val = eval $point;
736 print "# $point: \$@='$@'\n";
738 } elsif (!defined $bearing) {
739 print "# $point: \$val=undef\n";
741 } elsif ($val != $bearing) {
742 print "# $point: \$val=$val, not $bearing\n";
747 print "not ok $test\n";
755 $test_body .= <<"EOT";
756 my \$rfc1149 = RFC1149;
757 if (\$rfc1149 ne "$parent_rfc1149") {
758 print "not ok \$test # '\$rfc1149' ne '$parent_rfc1149'\n";
764 if (\$rfc1149 != 1149) {
765 printf "not ok \$test # %d != 1149\n", \$rfc1149;
773 $test_body .= <<'EOT';
779 print "not ok $test # \$open='$open'\n";
785 end_tests("Simple tests", \@items, \@export_names, $header, $test_body,
792 my ($inf, $pound_bytes, $pound_utf8);
795 # Check that we can distiguish the pathological case of a string, and the
796 # utf8 representation of that string.
797 $pound_utf8 = $pound . '1';
798 if ($better_than_56) {
799 $pound_bytes = $pound_utf8;
800 utf8::encode ($pound_bytes);
802 # Must have that "U*" to generate a zero length UTF string that forces
803 # top bit set chars (such as the pound sign) into UTF8, so that the
804 # unpack 'C*' then gets the byte form of the UTF8.
805 $pound_bytes = pack 'C*', unpack 'C*', $pound_utf8 . pack "U*";
808 my @items = (@common_items,
809 {name=>$inf, type=>"PV", value=>'"Infinity"', macro=>1},
810 {name=>$pound_utf8, type=>"PV", value=>'"1 Pound"', macro=>1},
811 {name=>$pound_bytes, type=>"PV", value=>'"1 Pound (as bytes)"',
817 The above set of names seems to produce a suitably bad set of compile
818 problems on a Unicode naive version of ExtUtils::Constant (ie 0.11):
820 nick@thinking-cap 15439-32-utf$ PERL_CORE=1 ./perl lib/ExtUtils/t/Constant.t
822 # perl=/stuff/perl5/15439-32-utf/perl
823 # ext-30370 being created...
824 Wide character in print at lib/ExtUtils/t/Constant.t line 140.
828 ExtTest.xs: In function `constant_1':
829 ExtTest.xs:80: warning: multi-character character constant
830 ExtTest.xs:80: warning: case value out of range
837 # Do this in 7 bit in case someone is testing with some settings that cause
838 # 8 bit files incapable of storing this character.
840 = map {"'" . join (",", unpack "U*", $_ . pack "U*") . "'"}
841 ($pound, $inf, $pound_bytes, $pound_utf8);
842 # Values is a list of strings, such as ('194,163,49', '163,49')
844 my $test_body .= "my \$test = $dummytest;\n";
845 $dummytest += 7 * 3; # 3 tests for each of the 7 things:
847 $test_body .= << 'EOT';
850 my $better_than_56 = $] > 5.007;
852 my ($pound, $inf, $pound_bytes, $pound_utf8) = map {eval "pack 'U*', $_"}
855 $test_body .= join ",", @values;
857 $test_body .= << 'EOT';
860 foreach (["perl", "rules", "rules"],
861 ["/*", "OPEN", "OPEN"],
862 ["*/", "CLOSE", "CLOSE"],
863 [$pound, 'Sterling', []],
864 [$inf, 'Infinity', []],
865 [$pound_utf8, '1 Pound', '1 Pound (as bytes)'],
866 [$pound_bytes, '1 Pound (as bytes)', []],
868 # Flag an expected error with a reference for the expect string.
869 my ($string, $expect, $expect_bytes) = @$_;
870 (my $name = $string) =~ s/([^ -~])/sprintf '\x{%X}', ord $1/ges;
871 print "# \"$name\" => \'$expect\'\n";
872 # Try to force this to be bytes if possible.
873 if ($better_than_56) {
874 utf8::downgrade ($string, 1);
876 if ($string =~ tr/0-\377// == length $string) {
877 # No chars outside range 0-255
878 $string = pack 'C*', unpack 'U*', ($string . pack 'U*');
883 $test_body .= "my (\$error, \$got) = ${package}::constant (\$string);\n";
885 $test_body .= <<'EOT';
886 if ($error or $got ne $expect) {
887 print "not ok $test # error '$error', got '$got'\n";
892 print "# Now upgrade '$name' to utf8\n";
893 if ($better_than_56) {
894 utf8::upgrade ($string);
896 $string = pack ('U*') . $string;
900 $test_body .= "my (\$error, \$got) = ${package}::constant (\$string);\n";
902 $test_body .= <<'EOT';
903 if ($error or $got ne $expect) {
904 print "not ok $test # error '$error', got '$got'\n";
909 if (defined $expect_bytes) {
910 print "# And now with the utf8 byte sequence for name\n";
911 # Try the encoded bytes.
912 if ($better_than_56) {
913 utf8::encode ($string);
915 $string = pack 'C*', unpack 'C*', $string . pack "U*";
919 $test_body .= "my (\$error, \$got) = ${package}::constant (\$string);\n";
921 $test_body .= <<'EOT';
922 if (ref $expect_bytes) {
925 print "ok $test # error='$error' (as expected)\n";
927 print "not ok $test # expected error, got no error and '$got'\n";
929 } elsif ($got ne $expect_bytes) {
930 print "not ok $test # error '$error', expect '$expect_bytes', got '$got'\n";
939 end_tests("utf8 tests", \@items, [], "#define perl \"rules\"\n", $test_body);
942 # XXX I think that I should merge this into the utf8 test above.
943 sub explict_call_constant {
944 my ($string, $expect) = @_;
945 # This does assume simple strings suitable for ''
946 my $test_body = <<"EOT";
948 my (\$error, \$got) = ${package}::constant ('$string');\n;
951 if (defined $expect) {
953 $test_body .= <<"EOT";
954 if (\$error or \$got ne "$expect") {
955 print "not ok $dummytest # error '\$error', expect '$expect', got '\$got'\n";
957 print "ok $dummytest\n";
963 $test_body .= <<"EOT";
965 print "ok $dummytest # error='\$error' (as expected)\n";
967 print "not ok $dummytest # expected error, got no error and '\$got'\n";
972 return $test_body . <<'EOT';
977 # Simple tests to verify bits of the switch generation system work.
980 # Deliberately leave $name in @_, so that it is indexed from 1.
981 my ($name, @items) = @_;
983 my $test_body = "my \$value;\n";
984 foreach my $counter (1 .. $#_) {
985 my $thisname = $_[$counter];
986 $test_header .= "#define $thisname $counter\n";
987 $test_body .= <<"EOT";
989 if (\$value == $counter) {
990 print "ok $dummytest\n";
992 print "not ok $dummytest # $thisname gave \$value\n";
996 # Yes, the last time round the loop appends a z to the string.
997 for my $i (0 .. length $thisname) {
998 my $copyname = $thisname;
999 substr ($copyname, $i, 1) = 'z';
1000 $test_body .= explict_call_constant ($copyname,
1001 $copyname eq $thisname
1002 ? $thisname : undef);
1005 # Ho. This seems to be buggy in 5.005_03:
1006 # # Now remove $name from @_:
1008 end_tests($name, \@items, \@items, $test_header, $test_body);
1011 # Check that the memeq clauses work correctly when there isn't a switch
1012 # statement to bump off a character
1013 simple ("Singletons", "A", "AB", "ABC", "ABCD", "ABCDE");
1014 # Check the three code.
1015 simple ("Three start", qw(Bea kea Lea lea nea pea rea sea tea Wea yea Zea));
1016 # There were 162 2 letter words in /usr/share/dict/words on FreeBSD 4.6, which
1017 # I felt was rather too many. So I used words with 2 vowels.
1018 simple ("Twos and three middle", qw(aa ae ai ea eu ie io oe era eta));
1019 # Given the choice go for the end, else the earliest point
1020 simple ("Three end and four symetry", qw(ean ear eat barb marm tart));
1023 # Need this if the single test below is rolled into @tests :
1025 print "1..$dummytest\n";
1027 write_and_run_extension @$_ foreach @tests;
1029 # This was causing an assertion failure (a C<confess>ion)
1030 # Any single byte > 128 should do it.
1031 C_constant ($package, undef, undef, undef, undef, undef, chr 255);
1032 print "ok $realtest\n"; $realtest++;
1034 print STDERR "# You were running with \$keep_files set to $keep_files\n"