File: 50subclass.t

package info (click to toggle)
libstring-tagged-perl 0.24-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 304 kB
  • sloc: perl: 2,105; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

package STSubclass;
use base qw( String::Tagged );

package main;

my $foo = STSubclass->new( "foo" );
isa_ok( $foo, [ "STSubclass" ], '$foo' );
isa_ok( $foo, [ "String::Tagged" ], '$foo' );

isa_ok( $foo . "bar", [ "STSubclass" ], 'concat plain after' );
isa_ok( "bar" . $foo, [ "STSubclass" ], 'concat plain before' );

my $bar = String::Tagged->new( "bar" );

isa_ok( $foo . $bar, [ "STSubclass" ], 'concat plain after' );
isa_ok( $bar . $foo, [ "STSubclass" ], 'concat plain before' );

done_testing;