xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/op/stash.t (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!./perl
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateBEGIN {
4*0Sstevel@tonic-gate    chdir 't' if -d 't';
5*0Sstevel@tonic-gate    @INC = qw(../lib);
6*0Sstevel@tonic-gate}
7*0Sstevel@tonic-gate
8*0Sstevel@tonic-gaterequire "./test.pl";
9*0Sstevel@tonic-gate
10*0Sstevel@tonic-gateplan( tests => 2 );
11*0Sstevel@tonic-gate
12*0Sstevel@tonic-gate# Used to segfault (bug #15479)
13*0Sstevel@tonic-gatefresh_perl_is(
14*0Sstevel@tonic-gate    '%:: = ""',
15*0Sstevel@tonic-gate    'Odd number of elements in hash assignment at - line 1.',
16*0Sstevel@tonic-gate    { switches => [ '-w' ] },
17*0Sstevel@tonic-gate    'delete $::{STDERR} and print a warning',
18*0Sstevel@tonic-gate);
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate# Used to segfault
21*0Sstevel@tonic-gatefresh_perl_is(
22*0Sstevel@tonic-gate    'BEGIN { $::{"X::"} = 2 }',
23*0Sstevel@tonic-gate    '',
24*0Sstevel@tonic-gate    { switches => [ '-w' ] },
25*0Sstevel@tonic-gate    q(Insert a non-GV in a stash, under warnings 'once'),
26*0Sstevel@tonic-gate);
27