File: comments.t

package info (click to toggle)
libmethod-signatures-perl 20120523-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 468 kB
  • sloc: perl: 2,060; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download
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

use strict;
use warnings;

use Test::More;
use Test::Exception;

use Method::Signatures;


lives_ok
{
    eval q{
        func foo (
            Int :$foo,              # this is foo
            Int :$bar               # this is bar
        )
        {
        }

        1;
    } or die;
}
'survives comments within the signature itself';

lives_ok
{
    eval q{
        func bar ( Int :$foo, Int :$bar )       # this is a signature
        {
        }

        1;
    } or die;
}
'survives comments between signature and open brace';

SKIP:
{
    eval { require MooseX::Declare } or skip "MooseX::Declare required for this test", 1;

    lives_ok
    {
        eval q{
            use MooseX::Declare;
            use Method::Signatures::Modifiers;

            class Foo
            {
                method bar ( Int :$foo, Int :$bar )     # this is a signature
                {
                }
            }

            1;
        } or die;
    }
    'survives comments between signature and open brace';
}


done_testing();