Mercurial > pub > Impl
comparison Lib/IMPL/Test.pm @ 84:e568c7c8b743
Minor changes to the test infrastructure
author | wizard |
---|---|
date | Wed, 14 Apr 2010 17:38:11 +0400 |
parents | 16ada169ca75 |
children | f8de52d3c112 |
comparison
equal
deleted
inserted
replaced
83:74bae30eb25e | 84:e568c7c8b743 |
---|---|
1 package IMPL::Test; | 1 package IMPL::Test; |
2 use strict; | 2 use strict; |
3 use warnings; | 3 use warnings; |
4 | 4 |
5 require IMPL::Test::SkipException; | |
6 | |
5 require Exporter; | 7 require Exporter; |
6 our @ISA = qw(Exporter); | 8 our @ISA = qw(Exporter); |
7 our @EXPORT_OK = qw(&test &shared &failed &cmparray); | 9 our @EXPORT_OK = qw(&test &shared &failed &cmparray &skip); |
8 | 10 |
9 require IMPL::Test::Unit; | 11 require IMPL::Test::Unit; |
10 use IMPL::Class::Member; | 12 use IMPL::Class::Member; |
11 | 13 |
12 sub test($$) { | 14 sub test($$) { |
32 | 34 |
33 sub failed($;@) { | 35 sub failed($;@) { |
34 die new IMPL::Test::FailException(@_); | 36 die new IMPL::Test::FailException(@_); |
35 } | 37 } |
36 | 38 |
39 sub skip($;@) { | |
40 die new IMPL::Test::SkipException(@_); | |
41 } | |
42 | |
37 sub cmparray { | 43 sub cmparray { |
38 my ($a,$b) = @_; | 44 my ($a,$b) = @_; |
39 | 45 |
40 return 0 unless @$a == @$b; | 46 return 0 unless @$a == @$b; |
41 | 47 |