From: Nicholas Clark Date: Fri, 18 Sep 2009 13:14:57 +0000 (+0100) Subject: Avoid re-creating a temporary file with constant contents for use.t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b17397621f1e997fadd615214400d296c2677d96;p=p5sagit%2Fp5-mst-13.2.git Avoid re-creating a temporary file with constant contents for use.t --- diff --git a/MANIFEST b/MANIFEST index 20bdcd0..b987cc7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4203,6 +4203,7 @@ t/lib/Sans_mypragma.pm Test module for t/lib/mypragma.t t/lib/strict/refs Tests of "use strict 'refs'" for strict.t t/lib/strict/subs Tests of "use strict 'subs'" for strict.t t/lib/strict/vars Tests of "use strict 'vars'" for strict.t +t/lib/test_use_14937.pm A test pragma for t/comp/use.t t/lib/test_use.pm A test pragma for t/comp/use.t t/lib/warnings/1global Tests of global warnings for warnings.t t/lib/warnings/2use Tests for "use warnings" for warnings.t diff --git a/t/comp/use.t b/t/comp/use.t index 56d2d81..a7ecda8 100755 --- a/t/comp/use.t +++ b/t/comp/use.t @@ -191,12 +191,9 @@ is("@test_use::got", "joe"); { # Regression test for patch 14937: # Check that a .pm file with no package or VERSION doesn't core. - open F, ">xxx$$.pm" or die "Cannot open xxx$$.pm: $!\n"; - print F "1;\n"; - close F; - eval "BEGIN {unshift \@INC, '.'}; use xxx$$ 3;"; - like ($@, qr/^xxx$$ defines neither package nor VERSION--version check failed at/); - unlink "xxx$$.pm"; + # (git commit 2658f4d9934aba5f8b23afcc078dc12b3a40223) + eval "use test_use_14937 3"; + like ($@, qr/^test_use_14937 defines neither package nor VERSION--version check failed at/); } my @ver = split /\./, sprintf "%vd", $^V; diff --git a/t/lib/test_use_14937.pm b/t/lib/test_use_14937.pm new file mode 100644 index 0000000..0afc604 --- /dev/null +++ b/t/lib/test_use_14937.pm @@ -0,0 +1 @@ +1;