File: immutable_roundtrip.t

package info (click to toggle)
libmoose-perl 2.2207-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,416 kB
  • sloc: perl: 21,345; ansic: 291; makefile: 10
file content (35 lines) | stat: -rw-r--r-- 724 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use strict;
use warnings;
use Test::Needs 'Test::Output';  # skip all if not installed

use Test::More;

use Test::Output;

{
    package Foo;
    use Moose;
    __PACKAGE__->meta->make_immutable;
}

{
    package Bar;
    use Moose;

    extends 'Foo';

    __PACKAGE__->meta->make_immutable;
    __PACKAGE__->meta->make_mutable;


    # This actually is testing for a bug in Class::MOP that cause
    # Moose::Meta::Method::Constructor to spit out a warning when it
    # shouldn't have done so. The bug was fixed in CMOP 0.75.
    ::stderr_unlike(
        sub { Bar->meta->make_immutable },
        qr/Not inlining a constructor/,
        'no warning that Bar may not have an inlined constructor'
    );
}

done_testing;