]> git.ozlabs.org Git - ponghero.git/blob - ccan/ccan_tools/libtap/tests/todo/test.pl
Prepare for release: rename to ponghero and pull in ccan.
[ponghero.git] / ccan / ccan_tools / libtap / tests / todo / test.pl
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More;
7
8 my $rc = 0;
9
10 plan tests => 5;
11
12 my $side_effect = 0;            # Check whether TODO has side effects
13
14 $rc = ok(1 == 1, '1 equals 1'); # Test ok() passes when it should
15 diag("Returned: $rc");
16
17 # Start TODO tests
18 TODO: {
19         local $TODO = 'For testing purposes';
20
21         $side_effect++;
22
23         # This test should fail
24         $rc = ok($side_effect == 0, 'side_effect checked out');
25         diag("Returned: $rc");
26
27         # This test should unexpectedly succeed
28         $rc = ok($side_effect == 1, 'side_effect checked out');
29         diag("Returned: $rc");
30 }
31
32 TODO: {
33         local $TODO = 'Testing printf() expansion in todo_start()';
34
35         $rc = ok(0, 'dummy test');
36         diag("Returned: $rc");
37 }
38
39 $rc = ok($side_effect == 1, "side_effect is $side_effect");
40 diag("Returned: $rc");