another mro patch
[p5sagit/p5-mst-13.2.git] / t / comp / asstcompat.t
CommitLineData
aefc56c5 1#!./perl
2
e76bdc3c 3BEGIN { $^W = 0 }
4
aefc56c5 5my $i = 1;
6sub ok {
7 my $ok = shift;
8 print( ($ok ? '' : 'not '), "ok $i", (@_ ? " - @_" : ''), "\n");
9 $i++;
10}
11
12print "1..7\n";
13
14# 1
15use base 'assertions::compat';
16ok(eval "sub assert_foo : assertion { 0 } ; 1", "handle assertion attribute");
17
18use assertions::activate 'Foo';
19
20# 2
21use assertions::compat asserting_2 => 'Foo';
22ok(asserting_2, 'on');
23
24# 3
25use assertions::compat asserting_3 => 'Bar';
26ok(!asserting_3, 'off');
27
28# 4
29use assertions::compat asserting_4 => '_ || Bar';
30ok(!asserting_4, 'current off or off');
31
32# 5
33use assertions::compat asserting_5 => '_ || Foo';
34ok(asserting_5, 'current off or on');
35
36# 6
37use assertions::compat asserting_6 => '_ || Bar';
38ok(asserting_6, 'current on or off');
39
40# 7
41use assertions::compat asserting_7 => '_ && Foo';
42ok(asserting_7, 'current on and on');