summaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAgeFilesLines
* pp.c & sv.c: pp_ref UTF8 and null cleanup.Brian Fraser2011-10-062-5/+4
| | | | | | | | | This adds a new function to sv.c, sv_ref, which is a nul-and-UTF8 clean version of sv_reftype. pp_ref now uses that. sv_ref() not only returns the SV, but also takes in an SV to modify, so we can say both sv_ref(TARG, obj, TRUE); and sv = sv_ref(NULL, obj, TRUE);
* pp.c: pp_bless UTF8 cleanup.Brian Fraser2011-10-061-0/+127
| | | | | Some tests in t/uni/bless.t are TODO, as ref() isn't clean yet.
* op.c: Flag named methods if they are in UTF-8.Brian Fraser2011-10-061-0/+40
|
* pp_hot.c: method_common is UTF-8 aware.Brian Fraser2011-10-061-1/+17
| | | | | | | | | | Not really useful yet, since named methods aren't correctly flagged; that is to access a \x{30cb} method, you'd need to do something like Obj->${\"\x{30cb}"}. Committer’s note: I’m also including one piece of the ‘gv.c and pp_ctl.c warnings’ patch so that the newly-added tests in this commit pass.
* pp_ctl.c: pp_goto UTF8 cleanup.Brian Fraser2011-10-061-0/+41
|
* Tests for UTF-8 GVs.Brian Fraser2011-10-061-0/+853
| | | | | | | Basically t/op/gv.t with UTF-8 names. A vast majority of the tests currently fail and are marked as TODO; Minus for failures related to prototypes, these will start working in the following commits.
* op.c: newCONSTSUB and newXS UTF8 cleanup.Brian Fraser2011-10-061-1/+6
| | | | | | | | newXS was merged into newXS_flags; added a line in the docs recommeding using that instead. newCONSTSUB got a _flags version, which generates the CV in the right glob if passed the UTF-8 flag.
* Basic tests for UTF-8 vars.Brian Fraser2011-10-061-0/+93
|
* podcheck.t: Guard against weird input file typesKarl Williamson2011-10-031-2/+6
| | | | | | | | This causes podcheck to only analyze non-zero length files that we can read and are plain files or symbolic links. Perhaps symbolic links should be skipped as well. In the current blead, experimenting with doing that made no difference.
* Add another exception to dual-life.tFather Chrysostomos2011-10-021-9/+8
| | | | | | | | | | | | | Module::Build’s tests create a file named something like cpan/Module-Build/MB-rrWnCs8O/Simple/bin/foo.PL during testing, causing dual-life.t to fail when testing in parallel. This commit adds that to the list of exceptions, but since the exact name can vary, it changes the exception list into a regular expression.
* Stop dual-life.t from failing during parallel testingFather Chrysostomos2011-10-021-1/+1
| | | | | | | | | | | dual-life.t makes sure all dual-lifed scripts make their way into utils/ during make. ExtUtils::Install creates a test script in dist/ExtUtils-Install/t/Big-Dummy/bin/program during testing. dual-life.t should skip anything containing /t/, to avoid failing erroneously.
* Add tests for isIDFirstKarl Williamson2011-10-011-1/+28
|
* Revise diagnostic textKarl Williamson2011-10-011-2/+2
| | | | I believe that the new wording is clearer than the older, which I wrote.
* utf8.c: Don't invert beyond-Unicode code pointsKarl Williamson2011-10-011-1/+15
| | | | | | | The Unicode properties are defined only on Unicode code points. In the past, this meant all property matches would fail for non-Unicode code points. However, starting with 5.15.1 some properties do succeed. This restores the previous behavior.
* [perl #99984] Incorrect errmsg with our $::éFather Chrysostomos2011-10-011-1/+8
| | | | | | | | Having PL_parser->error_count set to non-zero when utf8_heavy.pl tries to do() one of its swashes results in ‘Compilation error’ being placed in $@ during the do, even if it was successful. This patch sets the error_count to 0 before calling SWASHNEW, to prevent that. It uses SAVEI8, to make sure it is restored on scope exit.
* Where available, use _NSGetExecutablePath() to make $^X absolute.Nicholas Clark2011-09-271-1/+2
| | | | | | | | | In Configure, check whether _NSGetExecutablePath() can be used to find the absolute pathname of the executable. If so, set usensgetexecutablepath in config.sh and USE_NSGETEXECUTABLEPATH in config.h. If this is set, then use this approach in S_set_caret_X() to canonicalise $^X as an absolute path. This approach works on OS X, and possible on other platforms that use dyld.
* Where available, use sysctl() with KERN_PROC_PATHNAME to make $^X absolute.Nicholas Clark2011-09-271-2/+3
| | | | | | | | | | In Configure, check whether sysctl() and KERN_PROC_PATHNAME can be used to find the absolute pathname of the executable. If so, set usekernprocpathname in config.sh and USE_KERN_PROC_PATHNAME in config.h. If this is set, then use this approach in S_set_caret_X() to canonicalise $^X as an absolute path. This approach works on (at least) FreeBSD, and doesn't rely on the /proc filesystem existing, or /proc/curproc/file being present.
* Avoid a "use of uninitialized value" warning from pwent.tNicholas Clark2011-09-271-0/+4
| | | | | | | | | | | | | | 16acebfd4bd4723d refactored parts of t/op/pwent.t and enabled warnings. The refactoring was not the cause - the previous t/op/pwent.t code would warn if run with -w. On OS X (and presumably any other platform where the test processes the output of /usr/bin/dscl), where a user does not have a real name, dscl does not output a corresponding line, and as a result the test's processing code had undef in a data structure. The implicit conversion of this to an empty string was correct for the test to pass, but generates a warning when warnings are enabled. Hence disable this specific warning for the minimal scope where the conversion is wanted behaviour.
* podcheck.t: Work for scripts/utilities under VMSKarl Williamson2011-09-261-4/+33
| | | | | | | As noted in the comments in the code for this commit, VMS builds add a '.com' suffix to scripts and utilities and hence their names don't match what is in podcheck's db. This canonicalizes such names back to what the db is expecting.
* t/re/re_tests: Add TODOKarl Williamson2011-09-251-0/+3
|
* podcheck.t: New method for skipping .PL filesKarl Williamson2011-09-251-11/+20
| | | | | | | | | This reverts most of commit df80274d3278c640a5e0fbf3982950bb5ca9d7bc and uses a different method to exclude .PL files, suggested by Nicholas Clark. It uses the MANIFEST to find such files and then excludes them based on the full path name.
* podcheck.t: Remove extra loop initializationKarl Williamson2011-09-251-12/+6
| | | | | I think its clearer to put the subroutine call in each line of initialization
* podcheck.t: Move hash declaration to earlier in fileKarl Williamson2011-09-251-17/+16
| | | | | The only change is to move a block of code around. This is to prepare for future commits
* podcheck.t: Move subroutine defn earlier in fileKarl Williamson2011-09-251-17/+16
| | | | | This is to prepare for future commits, to avoid a warning message about prototype checking
* podcheck.t: Don't calc value twiceKarl Williamson2011-09-251-1/+1
|
* podcheck.t: remove unused variableKarl Williamson2011-09-251-1/+0
|
* regexp.t: print diagnostics with leading '#'Karl Williamson2011-09-241-3/+8
| | | | | Some test platforms don't like unexpected output without the comment prefix character
* Add t/porting/checkcfgvar.t to run Porting/checkcfgvar.pl as a test.Nicholas Clark2011-09-241-0/+29
| | | | | | | | Add TAP generation and a --tap option to Porting/checkcfgvar.pl. In checkcfgvar.t, document its purpose, and the likely way to fix the problems that it has flagged up. This is a prototype before adding similar instructions to the other t/porting tests.
* Refactor t/porting/regen.t to use TestInit q(T A);Nicholas Clark2011-09-241-13/+2
| | | | | | Previously it had custom code to change directory to the top of the source tree, and to convert the library paths to absolute. TestInit has common code for this.
* Move the test for recursive call to Perl_load_module to t/io/perlio.tNicholas Clark2011-09-232-13/+15
| | | | | It's a croak(), not a warning, so doesn't really belong in lib/warnings.t [This also implicitly fixes the wrong expected output of 69dc7e4bdb8e397c]
* Correct the expected results for the first perlio warnings subtest.Nicholas Clark2011-09-231-1/+2
|
* Test perl #96008: use and require affected by open.pmFather Chrysostomos2011-09-221-1/+11
|
* Move/rewrite test for Recursive call to Perl_load_moduleFather Chrysostomos2011-09-221-0/+11
| | | | | | | | | | This test was relying on a bug in require that causes it to use what- ever I/O layers are active in require‘s *caller* when opening a file [perl #96008]. This rewrites the test using the example in ticket #75722. Since it no longer has anything to do with open.pm, it is now in t/lib/warnings/perlio.
* Make CORE->method workFather Chrysostomos2011-09-221-0/+6
| | | | | | | | | | This will probably not be used, but ought to be here for complete- ness’ sake. Method lookup needs to trigger the autovivification of coresubs. Since it does not use gv_fetchpvn_flags, the coresub-autovification is now in a separate static function, so that both standard gv lookup and method lookup can share it.
* re_tests: Add TODO testKarl Williamson2011-09-221-0/+3
|
* podcheck.t: Add commentKarl Williamson2011-09-221-1/+2
|
* manifest.t: Clarify a test's wordingKarl Williamson2011-09-221-1/+1
|
* podcheck.t: clarify its podKarl Williamson2011-09-221-5/+8
|
* podcheck.t: Is problem if cpan/non-cpan have same NAMEKarl Williamson2011-09-221-1/+4
| | | | | | | | | If a module whose upstream is cpan has the same NAME as a module that isn't, that is a problem that should be warned about, as we shouldn't be shipping two identically named modules, even if one is not under Perl core's control. (If two cpan modules have the same name, it is a problem as well, but not anything we can do anything about, so warn only when cpan warnings are enabled.)
* podcheck.t: Process files sorted caselesslyKarl Williamson2011-09-221-4/+4
| | | | | In some situations previously, case was not important in the sort order; this extends that to all situations.
* podcheck: Nits in commentsKarl Williamson2011-09-221-4/+4
|
* fold_grind.t: Ignore blank linesKarl Williamson2011-09-211-2/+3
| | | | | | This is in preparation for Unicode 6.1, which has blank lines in the .txt file that fold_grind reads. The line that strips off comments did not work on plain null lines.
* [perl #99660] Remove elems from hashes before freeing themFather Chrysostomos2011-09-211-1/+11
| | | | | | | Commit f50383f58 made the ‘HeVAL(entry) = &PL_sv_placeholder;’ in the hash-element-deletion code unconditional. In doing so, it put it after the if/else statement containing the SvREFCNT_dec. So the freed SV was visible in the hash to destructors called by SvREFCNT_dec.
* [perl #93590] $tainted ~~ [...] failingFather Chrysostomos2011-09-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When smartmatch is about to start, to avoid calling get-magic (e.g., FETCH methods) more than once, it copies any argument that has get-magic. Tainting uses get-magic to taint the expression. Calling mg_get(sv) on a tainted scalar causes PL_tainted to be set, causing any scalars modified by sv_setsv_flags to be tainted. That means that tainting magic gets copied from one scalar to another. So when smartmatch tries to copy the variable to avoid repeated calls to magic, it still copies taint magic to the new variable. For $scalar ~~ @array (or ~~ [...]), S_do_smartmatch calls itself recursively for each element of @array, with $scalar (on the suppos- edly non-magical copy of $scalar) on the left and the element on the right. In that recursive call, it again does the get-magic check and copies the argument. Since the copied of a tainted variable on the LHS is magical, it gets copied again. Since the first copy is a mortal (marked TEMP) with a refcount of one, the second copy steal its string buffer. The outer call to S_do_smartmatch then proceeds with the second ele- ment of @array, without realising that its copy of $scalar has lost its string buffer and is now undefined. So these produce incorrect results under -T (where $^X is ‘perl’): $^X =~ ["whatever", undef] # matches $^X =~ ["whatever", "perl"] # fails This problem did not start occurring until this commit: commit 8985fe98dcc5c0af2fadeac15dfbc13f553ee7fc Author: David Mitchell <davem@iabyn.com> Date: Thu Dec 30 10:32:44 2010 +0000 Better handling of magic methods freeing the SV mg_get used to increase the refcount unconditionally, pushing it on to the mortals stack. So the magical copy would have had a refcount of 2, preventing its string buffer from being stolen. Now it has a ref- erence count of 1. This commit solves it by adding a new parameter to S_do_smartmatch telling it that the variable has already been copied and does not even need to be checked. The $scalar~~@array case sets that parameter for the recursive calls. That avoids the whole string-stealing problem *and* avoids extra unnecessary SVs.
* The link to Devel::PPPort was not understood by porting/podcheck.t so we had ↵Stevan Little2011-09-201-1/+1
| | | | to teach it
* Skip 2 tests in t/op/filetest.t if t/TEST is a symlink.Nicholas Clark2011-09-201-0/+1
| | | | | | t/TEST is usually a regular file, but not always. For example, if one is building using a symlink forest (eg ./Configure -Dmksymlinks) then it will be a symlink.
* Re-generate known_pod_issues.datFlorian Ragwitz2011-09-191-0/+2
|
* Update skip count in t/op/filetest.t after 433644eed.Craig A. Berry2011-09-181-2/+2
|
* podcheck: Clean up known issuesKarl Williamson2011-09-181-1/+2
| | | | | When a link to a module is unknown, it is better to use the --add_link option to podcheck.t and not the --regen option
* Make -l always treat non-bareword arguments as file namesFather Chrysostomos2011-09-172-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Here is some suspicious code in Perl_my_lstat_flags: if (SvROK(sv) && isGV_with_GP(SvRV(sv)) && ckWARN(WARN_IO)) { Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s", GvENAME((const GV *)SvRV(sv))); return (PL_laststatval = -1); } The behaviour differs depending on whether warnings are enabled. That -1 turns into undef in pp_ftlink. So we get an undef return value with warnings on, but a file test on a file name otherwise. In 5.6.2, -l $foo always treated $foo as a file name. In 5.8+, if it is a reference (ignoring magic) and the reference points to a typeglob (ignoring magic) and io warnings are on, it warns and returns undef. So the only time that undef return is reached is when a warning has been emitted, so it’s code that will likely be corrected before it goes into production. Hence I think it unlikely that anyone could be relying on the behaviour of -l \*foo (under warnings). So this commit restores the 5.6 behaviour for that case.