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