diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-07 20:26:29 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-07 20:26:29 +0000 |
commit | 4d0ed6f7ca164e8f0de0f0e2228fdb2e304666cb (patch) | |
tree | 74bda6f69313aa6254187bb270db1bc8b3046dba | |
parent | 87ba1cf0601b0f7a78cf89e2b19c04887bae5595 (diff) | |
download | perl-4d0ed6f7ca164e8f0de0f0e2228fdb2e304666cb.tar.gz |
Clean up 1_compile.t; move tests to more consistent
places (t/ subdirectories); add integer.t (much of
the pragma is tested elsewhere but there is no one
centralized place)
p4raw-id: //depot/perl@11940
-rw-r--r-- | MANIFEST | 17 | ||||
-rw-r--r-- | ext/Fcntl/t/fcntl.t (renamed from ext/Fcntl/Fcntl.t) | 0 | ||||
-rw-r--r-- | ext/Fcntl/t/syslfs.t (renamed from ext/Fcntl/syslfs.t) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | ext/POSIX/t/posix.t (renamed from ext/POSIX/POSIX.t) | 0 | ||||
-rw-r--r-- | ext/POSIX/t/sigaction.t (renamed from ext/POSIX/sigaction.t) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/Env/t/array.t (renamed from lib/Env/array.t) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/Env/t/env.t (renamed from lib/Env/env.t) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | lib/File/Find/t/find.t (renamed from lib/File/Find/find.t) | 0 | ||||
-rw-r--r-- | lib/File/Find/t/taint.t (renamed from lib/File/Find/taint.t) | 0 | ||||
-rw-r--r-- | lib/integer.t | 46 | ||||
-rw-r--r-- | t/lib/1_compile.t | 135 | ||||
-rw-r--r-- | t/op/lfs.t | 2 |
12 files changed, 75 insertions, 125 deletions
@@ -300,10 +300,10 @@ ext/Errno/Errno.t See if Errno works ext/Errno/Errno_pm.PL Errno perl module create script ext/Errno/Makefile.PL Errno extension makefile writer ext/Fcntl/Fcntl.pm Fcntl extension Perl module -ext/Fcntl/Fcntl.t See if Fcntl works ext/Fcntl/Fcntl.xs Fcntl extension external subroutines ext/Fcntl/Makefile.PL Fcntl extension makefile writer -ext/Fcntl/syslfs.t See if large files work for sysio +ext/Fcntl/t/fcntl.t See if Fcntl works +ext/Fcntl/t/syslfs.t See if large files work for sysio ext/File/Glob/bsd_glob.c File::Glob extension run time code ext/File/Glob/bsd_glob.h File::Glob extension header file ext/File/Glob/Changes File::Glob extension changelog @@ -456,9 +456,9 @@ ext/POSIX/hints/uts.pl Hint for POSIX for named architecture ext/POSIX/Makefile.PL POSIX extension makefile writer ext/POSIX/POSIX.pm POSIX extension Perl module ext/POSIX/POSIX.pod POSIX extension documentation -ext/POSIX/POSIX.t See if POSIX works ext/POSIX/POSIX.xs POSIX extension external subroutines -ext/POSIX/sigaction.t See if POSIX::sigaction works +ext/POSIX/t/posix.t See if POSIX works +ext/POSIX/t/sigaction.t See if POSIX::sigaction works ext/POSIX/typemap POSIX extension interface types ext/re/hints/mpeix.pl Hints for re for named architecture ext/re/Makefile.PL re extension makefile writer @@ -841,8 +841,8 @@ lib/dumpvar.pl A variable dumper lib/English.pm Readable aliases for short variables lib/English.t See if English works lib/Env.pm Map environment into ordinary variables -lib/Env/array.t See if Env works -lib/Env/env.t See if Env works for arrays +lib/Env/t/array.t See if Env works for arrays +lib/Env/t/env.t See if Env works lib/exceptions.pl catch and throw routines lib/Exporter.pm Exporter base class lib/Exporter.t See if Exporter works @@ -886,8 +886,8 @@ lib/File/Copy.t See if File::Copy works lib/File/DosGlob.pm Win32 DOS-globbing module lib/File/DosGlob.t See if File::DosGlob works lib/File/Find.pm Routines to do a find -lib/File/Find/find.t See if File::Find works -lib/File/Find/taint.t See if File::Find works with taint +lib/File/Find/t/find.t See if File::Find works +lib/File/Find/t/taint.t See if File::Find works with taint lib/File/Path.pm Do things like `mkdir -p' and `rm -r' lib/File/Path.t See if File::Path works lib/File/Spec.pm portable operations on file names @@ -946,6 +946,7 @@ lib/I18N/LangTags/README I18N::LangTags lib/I18N/LangTags/test.pl See if I18N::LangTags works lib/importenv.pl Perl routine to get environment into variables lib/integer.pm For "use integer" +lib/integer.t For "use integer" testing lib/IPC/Open2.pm Open a two-ended pipe lib/IPC/Open2.t See if IPC::Open2 works lib/IPC/Open3.pm Open a three-ended pipe! diff --git a/ext/Fcntl/Fcntl.t b/ext/Fcntl/t/fcntl.t index 24ade27c92..24ade27c92 100644 --- a/ext/Fcntl/Fcntl.t +++ b/ext/Fcntl/t/fcntl.t diff --git a/ext/Fcntl/syslfs.t b/ext/Fcntl/t/syslfs.t index 8d9769fded..8d9769fded 100644 --- a/ext/Fcntl/syslfs.t +++ b/ext/Fcntl/t/syslfs.t diff --git a/ext/POSIX/POSIX.t b/ext/POSIX/t/posix.t index eddf38f2fb..eddf38f2fb 100755..100644 --- a/ext/POSIX/POSIX.t +++ b/ext/POSIX/t/posix.t diff --git a/ext/POSIX/sigaction.t b/ext/POSIX/t/sigaction.t index 1045db6c3c..1045db6c3c 100644 --- a/ext/POSIX/sigaction.t +++ b/ext/POSIX/t/sigaction.t diff --git a/lib/Env/array.t b/lib/Env/t/array.t index ff6af2edb8..ff6af2edb8 100755..100644 --- a/lib/Env/array.t +++ b/lib/Env/t/array.t diff --git a/lib/Env/env.t b/lib/Env/t/env.t index c5068fda14..c5068fda14 100755..100644 --- a/lib/Env/env.t +++ b/lib/Env/t/env.t diff --git a/lib/File/Find/find.t b/lib/File/Find/t/find.t index 0dfd68caf8..0dfd68caf8 100755..100644 --- a/lib/File/Find/find.t +++ b/lib/File/Find/t/find.t diff --git a/lib/File/Find/taint.t b/lib/File/Find/t/taint.t index 796402d442..796402d442 100644 --- a/lib/File/Find/taint.t +++ b/lib/File/Find/t/taint.t diff --git a/lib/integer.t b/lib/integer.t new file mode 100644 index 0000000000..4184747c3e --- /dev/null +++ b/lib/integer.t @@ -0,0 +1,46 @@ +use integer; + +use Test::More tests => 11; +use Config; + +my $x = 4.5; +my $y = 5.6; +my $z; + +$z = $x + $y; +is($z, 9, "plus"); + +$z = $x - $y; +is($z, -1, "minus"); + +$z = $x * $y; +is($z, 20, "times"); + +$z = $x / $y; +is($z, 0, "divide"); + +$z = $x / $y; +is($z, 0, "modulo"); + +is($x, 4.5, "scalar still floating point"); + +isnt(sqrt($x), 2, "functions still floating point"); + +isnt($x ** .5, 2, "power still floating point"); + +is(++$x, 5.5, "++ still floating point"); + +SKIP: { + my $ivsize = $Config{ivsize}; + skip "ivsize == $ivsize", 2 unless $ivsize == 4 || $ivsize == 8; + + if ($ivsize == 4) { + $z = 2**31 - 1; + is($z + 1, -2147483648, "left shift"); + } elsif ($ivsize == 8) { + $z = 2**63 - 1; + is($z + 1, -9223372036854775808, "left shift"); + } +} + +is(~0, -1, "unsigned"); diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index 625263a93d..a7871fcf3c 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -10,6 +10,7 @@ use warnings; use Config; my %Core_Modules; +my %Test; unless (open(MANIFEST, "MANIFEST")) { die "$0: failed to open 'MANIFEST': $!\n"; @@ -20,10 +21,20 @@ sub add_by_name { } while (<MANIFEST>) { - next unless m!^lib/(\S+?)\.pm!; - my $module = $1; - $module =~ s!/!::!g; - add_by_name($module); + if (m!^(lib)/(\S+?)\.pm\s!) { + # Collecting modules names from under ext/ would be + # rather painful since the mapping from filenames + # to module names is not 100%. + my ($dir, $module) = ($1, $2); + $module =~ s!/!::!g; + add_by_name($module); + } elsif (m!^(lib|ext)/(\S+?)(?:\.t|/test.pl)\s!) { + my ($dir, $test) = ($1, $2); + $test =~ s!(\w+)/\1$!$1! if $dir eq 'ext'; + $test =~ s!/t/[^/]+$!!; + $test =~ s!/!::!g; + $Test{$test}++; + } } close(MANIFEST); @@ -83,8 +94,12 @@ delete_by_prefix('unicode::'); # Delete all modules which have their own tests. # This makes this test a lot faster. +foreach my $mod (sort keys %Test) { + delete_by_name($mod); +} foreach my $mod (<DATA>) { chomp $mod; + print "### $mod\n" if exists $Test{$mod}; delete_by_name($mod); } @@ -115,16 +130,7 @@ sub compile_module { # Add here modules that have their own test scripts and therefore # need not be test-compiled by 1_compile.t. __DATA__ -AnyDBM_File -Attribute::Handlers -AutoLoader -B -B::Debug -B::Deparse B::ShowLex -B::Stash -Benchmark -CGI CGI::Apache CGI::Carp CGI::Cookie @@ -132,55 +138,15 @@ CGI::Form CGI::Pretty CGI::Switch CGI::Util -Carp Carp::Heavy -Class::ISA -Class::Struct -CPAN -Cwd -DB_File -Data::Dumper Devel::DProf -Devel::Peek -Devel::SelfStubber -Digest -Digest::MD5 -DirHandle Dumpvalue -Encode -English -Env -Errno -Exporter Exporter::Heavy ExtUtils::Constant ExtUtils::MakeMaker -Fatal -Fcntl -File::Basename -File::CheckTree -File::Compare -File::Copy -File::DosGlob -File::Find -File::Glob -File::Path -File::Spec -File::Spec::Functions -File::Temp -File::stat -FileCache -FileHandle -Filter::Simple Filter::Util::Call -FindBin GDBM_File -Getopt::Long -Getopt::Std -I18N::Langinfo -I18N::LangTags I18N::LangTags::List -I18N::Collate IO::Dir IO::File IO::Handle @@ -191,24 +157,13 @@ IO::Select IO::Socket IO::Socket::INET IO::Socket::UNIX -IPC::Open2 -IPC::Open3 -IPC::SysV -Lingua::KO::Hangul::Util -List::Util Locale::Constants Locale::Country Locale::Currency Locale::Language -Locale::Maketext -MIME::Base64 MIME::QuotedPrint Math::BigFloat -Math::BigInt Math::BigInt::Calc -Math::Complex -Math::Trig -Memoize Memoize::AnyDBM_File Memoize::Expire Memoize::ExpireFile @@ -217,15 +172,7 @@ Memoize::NDBM_File Memoize::SDBM_File Memoize::Storable NDBM_File -NEXT -Net::hostent -Net::netent -Net::protoent -Net::servent ODBM_File -Opcode -PerlIO -POSIX Pod::Checker Pod::Find Pod::Text @@ -233,64 +180,20 @@ Pod::Usage SDBM_File Safe Scalar::Util -Search::Dict -SelectSaver -SelfLoader -Shell -Socket -Storable -Switch -Symbol -Sys::Hostname Sys::Syslog -Term::ANSIColor -Test -Test::Harness Test::More -Test::Simple Test::ParseWords -Text::Abbrev -Text::Balanced -Text::ParseWords -Text::Soundex Text::Tabs Text::Wrap Thread Tie::Array Tie::Handle Tie::Hash -Tie::RefHash Tie::Scalar -Tie::SubstrHash -Time::HiRes -Time::Local -Time::gmtime -Time::localtime Time::tm -Unicode::Collate -Unicode::Normalize -Unicode::UCD UNIVERSAL -User::grent -User::pwent -XS::Typemap attributes -attrs -autouse base bytes -charnames -constant -diagnostics -fields -integer -less -locale ops -overload -strict -subs -utf8 -vars -warnings warnings::register diff --git a/t/op/lfs.t b/t/op/lfs.t index 2652555281..8be24f4d82 100644 --- a/t/op/lfs.t +++ b/t/op/lfs.t @@ -1,6 +1,6 @@ # NOTE: this file tests how large files (>2GB) work with perlio (stdio/sfio). # sysopen(), sysseek(), syswrite(), sysread() are tested in t/lib/syslfs.t. -# If you modify/add tests here, remember to update also t/lib/syslfs.t. +# If you modify/add tests here, remember to update also ext/Fcntl/t/syslfs.t. BEGIN { chdir 't' if -d 't'; |