summaryrefslogtreecommitdiff
path: root/t/comp/require.t
Commit message (Collapse)AuthorAgeFilesLines
* [perl #124153] Fix require(v5.6)Father Chrysostomos2015-03-271-1/+5
| | | | | | | For some reason the argument to require v5.6 has the NOK flag on, but the parenthesized version lacks that flag, so the code added in v5.21.3-504-ged6f447 to precompute the hash was wrong, and caused require(v5.6) to lose its vstringness.
* t/comp/require.t: No longer needed to skip on EBCDICKarl Williamson2015-03-051-2/+2
|
* allow PERL_DISABLE_PMC to be defined from anywhereDaniel Dragan2014-11-271-3/+8
| | | | | | | | I enable PERL_DISABLE_PMC in a .h, not in CCFLAGS. CCFLAGS on Unix typically has no -Ds in it, build options go into config.h, not Config.pm's CCFLAGS. This change allows PERL_DISABLE_PMC option to pass tests regardless of where it is defined. cpan/parent/t/parent-pmc.t is not fixed by this patch.
* Partial minitest fix-upFather Chrysostomos2014-08-231-1/+1
| | | | | | | | | | | | | | While minitest passes all its tests when everything has been built, it is sometimes useful to run it when nothing has been built but miniperl (especially when one is working on low-level stuff that breaks miniperl). Many tests fail if things have not been built yet because miniperl can’t find modules like re.pm. This patch fixes up some tests to find those modules and changes _charnames.pm to load File::Spec only when it needs it. There are still many more failures, but I’ll leave the rest for another time (or another hacker :-).
* '$! = EACCESS; require ...' could failDavid Mitchell2013-10-291-1/+16
| | | | | | | | When require is checking against a particular entry in @INC, it stats the potential pathname, and does various checks like skipping if it's a directory. In this case the stat succeeds, so $! is left unchanged. Later however, pp_require() checks for $! being EACCES. So if $! was already set before the require, this could influence require's behaviour.
* [perl #24482] Fix sort and require to treat CORE:: as keywordFather Chrysostomos2013-06-071-1/+10
|
* require.t: handle parallel runsDavid Mitchell2013-06-051-2/+14
| | | | | | | | | There are random smoke failures in this test script, which are consistent with multiple processes running the same test script in parallel, and writing/unlinking the same (hard-coded) temp files. As a temp hack, add a sleep(20) if this looks like its happening, and see if the smoke issues go away.
* add descriptions to require.t test outputDavid Mitchell2013-03-231-44/+44
| | | | | | This is particularly important as in several places, the ok or not ok message is generated in different ways depending on whether a require successfully executed and printed "ok" for example.
* Test that ‘require v5’ ignores sub named v5Father Chrysostomos2012-05-211-1/+6
| | | | | This is something I broke in my first (unapplied) attempt to clean up require’s parsing madness.
* [perl #70151] eval localises %^H at runtimeFather Chrysostomos2011-11-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn’t any more. Now the hints are localised in a separate inner scope surrounding the call to yyparse. This meant moving hint-handling code from pp_require and pp_entereval into S_doeval. Some tests in t/comp/hints.t were testing for the buggy behaviour, so they have been adjusted. Basically, this fixes sub import { eval "strict->import" } which should work the same way as sub import { strict->import } but was not working because %^H and $^H were being localised to the eval at its run time, not just its compilation. So the values assigned to %^H and $^H at the eval’s run time would simply be lost.
* Test perl #96008: use and require affected by open.pmFather Chrysostomos2011-09-221-1/+11
|
* skip a test that requires Cwd under miniperlTony Cook2011-08-231-8/+12
|
* Make ‘require func()’ work with .pm abs pathv5.14.0-RC3Father Chrysostomos2011-05-111-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | As of commit 282b29ee485, pp_requires passes an SV to S_doopen_pm, instead of char*/length pair. That commit also used sv_mortalcopy() to copy the sv when trying out a .pmc extension: + SV *const pmcsv = sv_mortalcopy(name); When the path is absolute, the sv passed to S_doopen_pm is the very sv that was passed to require. If it was returned from a (non-lvalue) sub-routine, it will be marked TEMP, so the buffer gets stolen. After the .pmc file is discovered to be nonexistent, S_doopen_pm then uses its original sv to open the .pm file. But the buffer has been stolen, so it’s trying to open undef, which fais. In the mean time, pp_require still has a pointer to the stolen buffer, which now has a .pmc extenion, it blithely reports that the .pmc file cannot be found, not realising that its string has changed out from under it. (Actually, if the file name were just the right length, it could be reallocated and we could end up with a crash.) This patch copies the sv more kindly.
* Make BEGIN {require 5.12.0} behave as documented.Nicholas Clark2010-11-251-1/+4
| | | | | | Previously in a BEGIN block, require was behaving identically to use 5.12.0 - ie erroneously executing the use feature ':5.12.0'; and use strict; use warnings behaviour, which only use was documented to provide.
* Fix -DPERL_NO_UTF16_FILTEREric Brine2009-11-301-3/+6
|
* Force OP_REQUIRE to scalar context at the end of ck_require and don't let it ↵Gerard Goossen2009-11-211-2/+1
| | | | become void context. Fixes problem with require not always being in scalar context.
* Add a TODO test for "require" always being in scalar context.Gerard Goossen2009-11-211-2/+4
|
* Move the test for require 5.11.0 not loading strictures to require.t from use.tNicholas Clark2009-10-091-1/+7
|
* Print the encoding name as part of the test, rather than on a separate line.Nicholas Clark2009-10-091-3/+1
|
* Refactor bytes_to_utf16() into a more generic routine that also handles UTF-8Nicholas Clark2009-10-091-8/+15
| | | | | Remove the direct code for testing UTF-8, calling bytes_to_utf() from a loop for all 3 tested encodings.
* Move tests for use for "new style version numbers" to use.t from require.tNicholas Clark2009-10-091-9/+1
|
* Move &do_require to the top of require.t, so that @a is the first lexical.Nicholas Clark2009-10-081-7/+7
| | | | | | The relevant line, with comment, is: my @a; # magic guard for scope violations (must be first lexical in file)
* Move the test for RT #49472 to op/attrs.t from comp/require.tNicholas Clark2009-10-081-15/+1
|
* Avoid using bytes in require.t, as pack "C0U" does what we need.Nicholas Clark2009-10-081-2/+1
|
* Mark all .t and .pm files as non executableRafael Garcia-Suarez2009-06-061-0/+0
|
* [perl #49472] Attributes + Unkown ErrorDave Mitchell2008-02-091-1/+15
| | | | | | | An errored attribute sub still processes the attributes, which require's attribute.pm, so make sure the error state is passed to the new require p4raw-id: //depot/perl@33265
* Tests for the .pmc functionality.Nicholas Clark2007-10-091-4/+63
| | | p4raw-id: //depot/perl@32084
* do $file; won't propagate errors from die, as do is an implicit eval.Nicholas Clark2007-01-081-2/+2
| | | | | So need to propagate errors with $@. p4raw-id: //depot/perl@29723
* require should ignore directories found when searching @INC not justGisle Aas2006-03-161-1/+1
| | | | | | | | | die as soon as it finds one. It should for instance be possible to for require "File" to read the file "./File" even if there happens to be a "File" directory in perl's standard library. This fixes the RT #24404 fix in change 26373. p4raw-id: //depot/perl@27515
* Explain better how that test count works.Rafael Garcia-Suarez2006-01-181-3/+4
| | | p4raw-id: //depot/perl@26892
* New t/comp/require.t tests should go before the conditional exit.Nicholas Clark2006-01-181-9/+10
| | | p4raw-id: //depot/perl@26891
* Regression test for change #26881Rafael Garcia-Suarez2006-01-171-1/+10
| | | | | p4raw-link: @26881 on //depot/perl: ae706db49f17350f7e2ed5eccdc792223f4ea020 p4raw-id: //depot/perl@26883
* Don't code the absolute number of tests for the UTF8/EBCDIC case; muchNicholas Clark2006-01-061-1/+1
| | | | | better to subtract the number of tests that don't get run. p4raw-id: //depot/perl@26691
* comp/require.t exits early for the case of UTF-8 or EBCDIC, so need toNicholas Clark2005-12-161-11/+14
| | | | | add "new" tests before the end. p4raw-id: //depot/perl@26377
* Added test for change #26373.Steve Peters2005-12-151-2/+13
| | | | | p4raw-link: @26373 on //depot/perl: ce8abf5f5d2e5b19646ab17c24a3ea87c70428c8 p4raw-id: //depot/perl@26375
* Bring bleadperl up to version.pmJohn Peacock2005-06-131-1/+1
| | | | | Message-ID: <42A414DD.8090504@rowman.com> p4raw-id: //depot/perl@24823
* Revert change 23843.Rafael Garcia-Suarez2005-01-241-10/+8
| | | | | (See discussion for bug [perl #31924]) p4raw-id: //depot/perl@23873
* Re: [perl #31924] %INC caching failure-case problemRick Delaney2005-01-211-8/+10
| | | | | Message-ID: <20041013164018.GA32174@biff.bort.ca> p4raw-id: //depot/perl@23843
* Final version object core patch?John Peacock2004-08-041-1/+1
| | | | | Message-ID: <411048BD.3080700@rowman.com> p4raw-id: //depot/perl@23190
* Re: require patch breaks localeRick Delaney2003-10-091-1/+1
| | | | | Message-Id: <20031008224155.A14638@biff.bort.ca> p4raw-id: //depot/perl@21427
* (was Re: require() does not behave aas documented)Rick Delaney2003-10-061-2/+38
| | | | | Message-ID: <20030923121452.G18845@biff.bort.ca> p4raw-id: //depot/perl@21415
* Fix test count, by Abe Timmerman.Rafael Garcia-Suarez2003-06-281-1/+1
| | | p4raw-id: //depot/perl@19869
* Fix [perl #21742] :Rafael Garcia-Suarez2003-06-251-3/+3
| | | | | | require() should always be called in scalar context, even when it's the last statement in an eval(""). p4raw-id: //depot/perl@19851
* Revert change #19126, a poor attempt at fixing bug #21742.Marcus Holland-Moritz2003-06-161-1/+2
| | | | | | | | | | | The test for #21742 is marked as TODO. Plus new regression tests from : Subject: [perl #22708] void context in string eval is broken From: "Marcus Holland-Moritz" (via RT) <perlbug-followup@perl.org> Message-ID: <rt-22708-59432.14.6755501393177@rt.perl.org> p4raw-link: @19126 on //depot/perl: a89be09a10c36299e755a956d356eb7f1f643437 p4raw-id: //depot/perl@19801
* Fix bug #21742. require should be always invoked inRafael Garcia-Suarez2003-04-011-2/+18
| | | | | | | | | scalar context. This wasn't the case when called from an eval(""), because the void context doesn't propagate through the leaveeval op. Instead of making scalarvoid() handle OP_LEAVEEVAL -- this breaks AutoLoader -- implement a workaround in doeval(). p4raw-id: //depot/perl@19126
* If expecting UTF-8, probably not expecting UTF-16.Jarkko Hietaniemi2002-03-281-3/+4
| | | p4raw-id: //depot/perl@15584
* cleaner close on tests, take 2 Andreas König2001-12-291-1/+1
| | | | | | | Message-ID: <m33d1tvjuq.fsf@anima.de> (except for the three DB_File patch fragments) p4raw-id: //depot/perl@13940
* Drop all the unnecessary "use utf8" clauses and some ofJarkko Hietaniemi2001-08-121-1/+0
| | | | | | | | | | | the unnecessary "use bytes" ones. TODO: scour the documentation for unnecessary "use utf8" and prominently display it in perldelta when the time comes. ("use utf8" should be necessary ONLY if one wants the script to be in UTF-8.) Also should be checked in some non-ASCII non-Latin-1 platform, like EBCDIC. p4raw-id: //depot/perl@11638
* more tests (was Re: Perl5.7.* Unicode/EBCDIC status.)Peter Prymmer2001-03-301-2/+9
| | | | | Message-ID: <Pine.OSF.4.10.10103291731150.1326-100000@aspara.forte.com> p4raw-id: //depot/perl@9461
* Make print, syswrite, send, readline, getc honour utf8-ness of PerlIO.Nick Ing-Simmons2000-12-091-1/+2
| | | | | | | | | | | | | | | (sysread, recv and write i.e. formats still to do...) Allow :utf8 or :bytes in PerlIO_apply_layers() so that open($fh,">:utf8","name") etc. work. - "applying" those just sets/clears the UTF8 bit of the top layer, so no extra overhead is involved. Tweak t/comp/require.t to add a 'use bytes' to permit its dubious writing of BOM to a non-utf8 stream. Add initial io/utf8.t Fix SvPVutf8() - sv_2pv() was not expecting to be called with something that was already SvPOK() - (we just fossiked with SvUTF8 bit). Fix that and also just use the SvPV macro in sv_2pvutf8() to avoid the issue/overhead. p4raw-id: //depot/perlio@8054