This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Text-Balanced-1.98
[perl5.git] / lib / Text / Balanced / t / extcbk.t
index 10f9741..30b7e50 100644 (file)
@@ -1,3 +1,10 @@
+BEGIN {
+    if ($ENV{PERL_CORE}) {
+        chdir('t') if -d 't';
+        @INC = qw(../lib);
+    }
+}
+
 # Before `make install' is performed this script should be runnable with
 # `make test'. After `make install' it should work as `perl test.pl'
 
@@ -33,7 +40,7 @@ while (defined($str = <DATA>))
        my @res;
        $var = eval "\@res = $cmd";
        debug "\t   Failed: $@ at " . $@+0 .")" if $@;
-       debug "\t list got: [" . join("|",@res) . "]\n";
+       debug "\t list got: [" . join("|", map {defined $_ ? $_ : '<undef>'} @res) . "]\n";
        debug "\t list left: [$str]\n";
        print "not " if (substr($str,pos($str)||0,1) eq ';')==$neg;
        print "ok ", $count++;
@@ -52,12 +59,12 @@ while (defined($str = <DATA>))
 
 __DATA__
 
-# USING: extract_codeblock($str);
-{ $data[4] =~ /['"]/; };
-
 # USING: extract_codeblock($str,'(){}',undef,'()');
 (Foo(')'));
 
+# USING: extract_codeblock($str);
+{ $data[4] =~ /['"]/; };
+
 # USING: extract_codeblock($str,'<>');
 < %x = ( try => "this") >;
 < %x = () >;