File: mxms.t

package info (click to toggle)
libtest-routine-perl 0.031-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 296 kB
  • sloc: perl: 705; makefile: 2
file content (72 lines) | stat: -rw-r--r-- 1,809 bytes parent folder | download | duplicates (3)
1
2
3
4
5
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
#!perl
use strict;
use warnings;
use Test::More;
use Test::Moose;
use Test::Fatal;
use Test::Builder::Tester;

BEGIN {
    eval { require MooseX::Method::Signatures; 1 }
        || plan skip_all => "This test requires MooseX::Method::Signatures";
}

my $TBV = Test::Builder->VERSION;

{
    package Test::Foo;
    use Test::Routine;
    use Test::Routine::Util;
    use MooseX::Method::Signatures;

    ::is(::exception {
        test 'foo bar' => method {
            ::does_ok($self, 'Test::Foo');
        };
    }, undef, "can create tests with methods");

    if ($TBV >= 0.9805 && $TBV < 1.002) {
      ::test_out("    # tests work");
      ::test_out("        # foo bar");
    } elsif ($TBV > 1.002) {
      ::test_out("# tests work");
      ::test_out("    # foo bar");
    }
    ::test_out("        ok 1 - The object does Test::Foo");
    ::test_out("        1..1");
    ::test_out("    ok 1 - foo bar");
    ::test_out("    1..1");
    ::test_out("ok 1 - tests work");
    run_me('tests work');
    ::test_test();
}

{
    package Test::Bar;
    use Test::Routine;
    use Test::Routine::Util;
    use MooseX::Method::Signatures;

    ::is(::exception {
        test 'foo bar' => { description => 'foobar' } => method {
            ::does_ok($self, 'Test::Bar');
        };
    }, undef, "can create tests with methods");

    if ($TBV >= 0.9805 && $TBV < 1.002) {
      ::test_out("    # tests work");
      ::test_out("        # foobar");
    } elsif ($TBV > 1.002) {
      ::test_out("# tests work");
      ::test_out("    # foobar");
    }
    ::test_out("        ok 1 - The object does Test::Bar");
    ::test_out("        1..1");
    ::test_out("    ok 1 - foobar");
    ::test_out("    1..1");
    ::test_out("ok 1 - tests work");
    run_me('tests work');
    ::test_test();
}

done_testing;