File: inheritance.t

package info (click to toggle)
libspecio-perl 0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,132 kB
  • sloc: perl: 5,200; sh: 23; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 592 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
## no critic (Modules::ProhibitMultiplePackages)
use strict;
use warnings;

use Test::More 0.96;

use Specio::Library::Builtins;

# This test is about a bug where a parent class with a t() sub causes the t()
# sub to not be added in a child class that uses a type-exporter.
{
    package Parent;

    use Specio::Library::Builtins;

    sub type {
        t('Int');
    }
}

{
    package Child;

    use parent -norequire => 'Parent';

    use Specio::Library::Builtins;

    sub type {
        t('Str');
    }
}

is( Child::type(), t('Str'), 'Child class has a t() sub' );

done_testing();