Newer
Older
use strict;
use warnings;
Andy Yates
committed
use Test::More;
use Bio::EnsEMBL::Test::TestUtils;
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
use Bio::EnsEMBL::Utils::Exception qw(warning verbose throw info
deprecate stack_trace_dump stack_trace);
our $verbose= 0;
if(!$verbose) {
verbose('NONE');
}
#
#1 - test throw
#
eval {
throw('test exception');
};
ok($@);
debug($@);
#
#2-4 - Test verbosity, warnings
#
$verbose && verbose('EXCEPTION');
ok(verbose() == 1000 || (!$verbose && verbose() == 0));
warning('This warn should not appear');
ok(1);
warning('This warn should appear', 1000);
ok(1);
info("This info should not appear");
ok(1);
$verbose && verbose('ALL');
info("This info should appear");
ok(1);
#
# 5-6 Test stack trace
#
my $std = stack_trace_dump();
ok($std =~ /[A-Z]/);
debug(stack_trace_dump);
ok(stack_trace());
#
# 7 Test deprecate
#
test_deprecate();
ok(7);
sub test_deprecate {
deprecate('This deprecate warning should appear');
}
verbose('DEPRECATE');
Andy Yates
committed
done_testing();