File: 16_redefine.t

package info (click to toggle)
libhash-fieldhash-perl 0.15-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: perl: 1,249; ansic: 207; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 341 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!perl -w
# for RT #52073

use strict;
use Test::More tests => 2;

eval {
    package Foo;

    use Hash::FieldHash qw(:all);

    use warnings FATAL => 'redefine';

    fieldhash my %marine => 'marine';

    sub new { bless {}, shift }
    sub marine { 42 }
};
like $@, qr/Subroutine .+ redefined/xms;

my $o = Foo->new;
is $o->marine, 42;