File: isa.t

package info (click to toggle)
libtest-exception-perl 0.43-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 176 kB
  • ctags: 11
  • sloc: perl: 400; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /usr/bin/perl -Tw

use strict;
use warnings;

use Test::More tests => 1;
use Test::Exception;

{
    package MockFooException;
    
    sub new { bless {}, shift };
    sub isa { 
        my ( $self, $class ) = @_;
        return 1 if $class eq 'Foo';
        return $self->SUPER::isa( $class );
    }
}

throws_ok { die MockFooException->new } 'Foo', 
    'Understand exception classes that override isa';