diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-25 04:47:55 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-06-25 04:47:55 +0000 |
commit | 7e7ddbe33ca34359d711aee1e0ddebaeb40c2a18 (patch) | |
tree | 2a03e101e7b0302f5dcde62ed415a415ecca041d /t/010-isa-false-positive.t | |
download | Class-Load-tarball-7e7ddbe33ca34359d711aee1e0ddebaeb40c2a18.tar.gz |
Class-Load-0.23HEADClass-Load-0.23master
Diffstat (limited to 't/010-isa-false-positive.t')
-rw-r--r-- | t/010-isa-false-positive.t | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/t/010-isa-false-positive.t b/t/010-isa-false-positive.t new file mode 100644 index 0000000..7136fb6 --- /dev/null +++ b/t/010-isa-false-positive.t @@ -0,0 +1,67 @@ +use strict; +use warnings; +use Test::More 0.88; +use Test::Fatal; + +use lib 't/lib'; +use Test::Class::Load 'load_optional_class'; + +isnt( + exception { + load_optional_class('Class::Load::Error::DieAfterIsa'); + }, + undef, + 'Class which calls die is reported as an error' +); + +{ + local $TODO + = q{I'm not sure this is fixable as it's really an interpreter issue.}; + + isnt( + exception { + load_optional_class('Class::Load::Error::DieAfterIsa'); + }, + undef, + 'Class which calls die is reported as an error (second attempt)' + ); +} + +isnt( + exception { + load_optional_class('Class::Load::Error::DieAfterBeginIsa'); + }, + undef, + 'Class populates @ISA in BEGIN then dies - error on load' +); + +{ + local $TODO + = q{I'm not sure this is fixable as it's really an interpreter issue.}; + + isnt( + exception { + load_optional_class('Class::Load::Error::DieAfterBeginIsa'); + }, + undef, + 'Class populates @ISA in BEGIN then dies - error on load (second attempt)' + ); +} + +isnt( + exception { + load_optional_class('Class::Load::Error::SyntaxErrorAfterIsa'); + }, + undef, + 'Class with a syntax error causes an error' +); + +isnt( + exception { + load_optional_class('Class::Load::Error::SyntaxErrorAfterIsa'); + }, + undef, + 'Class with a syntax error causes an error (second attempt)' +); + +done_testing; |