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