summaryrefslogtreecommitdiff
path: root/t/op/attrhand.t
diff options
context:
space:
mode:
authorSascha Blank <unknown>2007-12-07 19:47:46 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-12-08 23:28:41 +0000
commitb384a05d76a2022ec642d8bd7b87bb7147132641 (patch)
treeec664e0256ba8c1b5b4448dc1cba5816a3d6a4f2 /t/op/attrhand.t
parent25ff843968f41a8aa0535a62280b51007713d2eb (diff)
downloadperl-b384a05d76a2022ec642d8bd7b87bb7147132641.tar.gz
[perl #48355] Handling of RAWDATA broken badly in Attribute::Handlers in perl 5.10.0 RC2
From: Sascha Blank (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-28750-1197114466-1411.48355-75-0@perl.org> p4raw-id: //depot/perl@32598
Diffstat (limited to 't/op/attrhand.t')
-rw-r--r--t/op/attrhand.t27
1 files changed, 26 insertions, 1 deletions
diff --git a/t/op/attrhand.t b/t/op/attrhand.t
index fb8069f6ce..8b11ac424b 100644
--- a/t/op/attrhand.t
+++ b/t/op/attrhand.t
@@ -6,7 +6,7 @@ BEGIN {
require './test.pl';
}
-plan tests => 1;
+plan tests => 4;
# test for bug #38475: parsing errors with multiline attributes
@@ -22,6 +22,26 @@ sub WrongAttr :ATTR(CODE,RAWDATA) {
::ok(0);
}
+sub CheckData :ATTR(RAWDATA) {
+ # check that the $data element contains the given attribute parameters.
+
+ if ($_[4] eq "12, 14") {
+ ::ok(1)
+ }
+ else {
+ ::ok(0)
+ }
+}
+
+sub CheckEmptyValue :ATTR() {
+ if (not defined $_[4]) {
+ ::ok(1)
+ }
+ else {
+ ::ok(0)
+ }
+}
+
package Deer;
use base 'Antler';
@@ -35,3 +55,8 @@ sub something : TypeCheck(
}
something();
+
+sub c :CheckData(12, 14) {};
+
+sub d1 :CheckEmptyValue() {};
+sub d2 :CheckEmptyValue {};