From ef097d42b8f645b77866f6e17a857c98be228046 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 24 Apr 2006 11:59:25 +0000 Subject: [PATCH] Add regression test for bug #38475 p4raw-id: //depot/perl@27950 --- MANIFEST | 1 + t/op/attrhand.t | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 t/op/attrhand.t diff --git a/MANIFEST b/MANIFEST index 2bfdfb6652..b7d57fe17b 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 0000000000..fb8069f6ce --- /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(); -- 2.34.1