~ubuntu-branches/ubuntu/precise/perl/precise

« back to all changes in this revision

Viewing changes to dist/constant/t/constant.t

  • Committer: Bazaar Package Importer
  • Author(s): Niko Tyni
  • Date: 2011-02-06 11:31:38 UTC
  • mto: (8.2.12 experimental) (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 46.
  • Revision ID: james.westby@ubuntu.com-20110206113138-lzpm3g6rur7i3eyp
Tags: upstream-5.12.3
ImportĀ upstreamĀ versionĀ 5.12.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
 
11
11
use strict;
12
 
use Test::More tests => 96;
 
12
use Test::More tests => 97;
13
13
my $TB = Test::More->builder;
14
14
 
15
15
BEGIN { use_ok('constant'); }
347
347
    eval 'use constant undef, 5; 1';
348
348
    like $@, qr/\ACan't use undef as constant name at /;
349
349
}
 
350
 
 
351
# [perl #76540]
 
352
# this caused panics or 'Attempt to free unreferenced scalar'
 
353
# (its a compile-time issue, so the die lets us skip the prints)
 
354
 
 
355
eval <<EOF;
 
356
use constant FOO => 'bar';
 
357
die "made it";
 
358
print FOO, "\n";
 
359
print FOO, "\n";
 
360
EOF
 
361
like($@, qr/made it/, "#76540");
 
362