Fix building MAD with C++ - a MAD_PV of "" is illegal, as it will be free()d.
[p5sagit/p5-mst-13.2.git] / t / comp / parser.t
index 0d2f4d6..9e1d427 100644 (file)
@@ -9,7 +9,7 @@ BEGIN {
 }
 
 BEGIN { require "./test.pl"; }
-plan( tests => 108 );
+plan( tests => 112 );
 
 eval '%@x=0;';
 like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -330,6 +330,9 @@ check(qr/^"BBFRPRAFPGHPP$/, 43, "actually missing a quote is still valid");
 #line 47 bang eth
 check(qr/^"BBFRPRAFPGHPP$/, 46, "but spaces aren't allowed without quotes");
 
+#line 77sevenseven
+check(qr/^"BBFRPRAFPGHPP$/, 49, "need a space after the line number");
+
 eval <<'EOSTANZA'; die $@ if $@;
 #line 51 "With wonderful deathless ditties|We build up the world's great cities,|And out of a fabulous story|We fashion an empire's glory:|One man with a dream, at pleasure,|Shall go forth and conquer a crown;|And three with a new song's measure|Can trample a kingdom down."
 check(qr/^With.*down\.$/, 51, "Overflow the second small buffer check");
@@ -351,5 +354,15 @@ eval <<'EOSTANZA'; die $@ if $@;
 check(qr/^Great hail!.*no more\.$/, 61, "Overflow both small buffer checks");
 EOSTANZA
 
+{
+    my @x = 'string';
+    is(eval q{ "$x[0]->strung" }, 'string->strung',
+       'literal -> after an array subscript within ""');
+    @x = ['string'];
+    # this used to give "string"
+    like("$x[0]-> [0]", qr/^ARRAY\([^)]*\)-> \[0]\z/,
+       'literal -> [0] after an array subscript within ""');
+}
+
 __END__
 # Don't add new tests HERE. See note above