Some more tests for \N
[p5sagit/p5-mst-13.2.git] / t / op / attrhand.t
index fb8069f..8c89f7f 100644 (file)
@@ -1,12 +1,16 @@
 #!/usr/bin/perl -w
 
 BEGIN {
+    if ($ENV{PERL_CORE_MINITEST}) {
+       print "1..0 # skip: miniperl can't load attributes\n";
+       exit 0;
+    }
     chdir 't' if -d 't';
     @INC = '../lib';
     require './test.pl';
 }
 
-plan tests => 1;
+plan tests => 4;
 
 # test for bug #38475: parsing errors with multiline attributes
 
@@ -22,6 +26,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 +59,8 @@ sub something : TypeCheck(
 }
 
 something();
+
+sub c :CheckData(12, 14) {};
+
+sub d1 :CheckEmptyValue() {};
+sub d2 :CheckEmptyValue {};