Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Perlito5 - indirect-object tests
  • Loading branch information
fglock committed Jul 12, 2013
1 parent f04ddf9 commit 360b966
Showing 1 changed file with 66 additions and 1 deletion.
67 changes: 66 additions & 1 deletion t5-bug/40-indirect-object.t
@@ -1,7 +1,7 @@
use feature 'say';
use strict;

say "1..43";
say "1..50";

{
package Exists;
Expand Down Expand Up @@ -298,5 +298,70 @@ $expect = '';
show();


#----- print and say with scalar

# # prints the object
# $code = 'print $object';
# $expect = '';
# show;

$code = 'say $object "# 123"';
$expect = 'Not a GLOB reference';
show;

$code = 'say $object "# 123"';
$expect = 'Not a GLOB reference';
show;

$code = 'say $object "# 123"';
$expect = 'Not a GLOB reference';
show;


#----- print and say with structure

# # prints the object
# $code = 'print $object';
# $expect = '';
# show;

# # String found where operator expected
# $code = 'say $object->[0] "# 123"';
# $expect = '';
# show;

# # String found where operator expected
# $code = 'say $object->[0] "# 123"';
# $expect = '';
# show;

# # String found where operator expected
# $code = 'say $object->[0] "# 123"';
# $expect = '';
# show;


#----- print and say with block

# prints the object
$code = 'print {$object->[0]}';
$expect = 'syntax error';
show;

# String found where operator expected
$code = 'say {$object->[0]} "# 123"';
$expect = 'Not an ARRAY reference';
show;

$code = 'say {$object->[0]} "# 123"';
$expect = 'Not an ARRAY reference';
show;

$code = 'say {$object->[0]} "# 123"';
$expect = 'Not an ARRAY reference';
show;



__END__

0 comments on commit 360b966

Please sign in to comment.