X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FFunction-Parameters.git;a=blobdiff_plain;f=t%2Fforeign%2FMethod-Signatures%2Fcomments.t;fp=t%2Fforeign%2FMethod-Signatures%2Fcomments.t;h=d1369e6001bab6bedb6ee022487ca1bc22f08dc5;hp=34bf716a4aa8bc4e9fa98a43423804555c21672f;hb=1a52f2db46f6d870454428a07bfae09e0359eeee;hpb=ff265988561375d3cf480004e29e3891094c0afb diff --git a/t/foreign/Method-Signatures/comments.t b/t/foreign/Method-Signatures/comments.t index 34bf716..d1369e6 100644 --- a/t/foreign/Method-Signatures/comments.t +++ b/t/foreign/Method-Signatures/comments.t @@ -3,9 +3,9 @@ use strict; use warnings FATAL => 'all'; use Test::More - eval { require Moose; 1 } - ? (tests => 2) - : (skip_all => "Moose required for testing types") + eval { require Moose; 1 } + ? (tests => 5) + : (skip_all => "Moose required for testing types") ; use Test::Fatal; @@ -43,24 +43,45 @@ is exception #{ # eval { require MooseX::Declare } or skip "MooseX::Declare required for this test", 1; # -# lives_ok -# { -# eval q{ + is exception + { + 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'; + + package Foo + { + method bar ( Int :$foo, Int :$bar ) # this is a signature + { + } + } + + 1; + } or die; + }, undef, + 'survives comments between signature and open brace'; #} -# -# + + +#TODO: { +# local $TODO = "closing paren in comment: rt.cpan.org 81364"; + + is exception + { +# # When this fails, it produces 'Variable "$bar" is not imported' +# # This is expected to fail, don't bother the user. +# no warnings; + eval q{ + fun special_comment ( + $foo, # ) + $bar + ) + { 42 } + 1; + } or die; + }, undef, + 'closing paren in comment'; + is eval q[special_comment("this", "that")], 42; +#} + #done_testing();