From: Rafael Garcia-Suarez Date: Mon, 24 Apr 2006 11:59:25 +0000 (+0000) Subject: Add regression test for bug #38475 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef097d42b8f645b77866f6e17a857c98be228046;p=p5sagit%2Fp5-mst-13.2.git Add regression test for bug #38475 p4raw-id: //depot/perl@27950 --- diff --git a/MANIFEST b/MANIFEST index 2bfdfb6..b7d57fe 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3326,6 +3326,7 @@ t/op/args.t See if operations on @_ work t/op/arith.t See if arithmetic works t/op/array.t See if array operations work t/op/assignwarn.t See if OP= operators warn correctly for undef targets +t/op/attrhand.t See if attribute handlers work t/op/attrs.t See if attributes on declarations work t/op/auto.t See if autoincrement et all work t/op/avhv.t See if pseudo-hashes work diff --git a/t/op/attrhand.t b/t/op/attrhand.t new file mode 100644 index 0000000..fb8069f --- /dev/null +++ b/t/op/attrhand.t @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = '../lib'; + require './test.pl'; +} + +plan tests => 1; + +# test for bug #38475: parsing errors with multiline attributes + +package Antler; + +use Attribute::Handlers; + +sub TypeCheck :ATTR(CODE,RAWDATA) { + ::ok(1); +} + +sub WrongAttr :ATTR(CODE,RAWDATA) { + ::ok(0); +} + +package Deer; +use base 'Antler'; + +sub something : TypeCheck( + QNET::Util::Object, + QNET::Util::Object, + QNET::Util::Object +) { # WrongAttr (perl tokenizer bug) + # keep this ^ lined up ! + return 42; +} + +something();