Skip to content

Commit

Permalink
Perlito5 - indirect-object tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed Jul 11, 2013
1 parent f8234de commit b1a510b
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions t5-bug/40-indirect-object.t
@@ -1,7 +1,7 @@
use feature 'say';
use strict;

say "1..25";
say "1..39";

{
package Exists;
Expand Down Expand Up @@ -218,5 +218,61 @@ $expect = 'Can\'t locate object method "not_exist" via package "This"';
show();


__END__

#----- glob

$code = 'this STDOUT; 1';
$expect = 'Can\'t locate object method "this" via package "IO::File"';
show();

# Number found where operator expected
$code = 'this STDOUT 123; 1';
$expect = 'Can\'t locate object method "this" via package "IO::File"';
show();

# Number found where operator expected
$code = 'my $x = this STDOUT 123; 1';
$expect = 'Can\'t locate object method "this" via package "IO::File"';
show();




#----- glob with parentheses

$code = 'this (STDOUT); 1';
$expect = 'Bareword "STDOUT" not allowed while "strict subs" in use';
show();

# # Number found where operator expected
# $code = 'this (STDOUT 123); 1';
# $expect = 'syntax error';
# show();
#
# # Number found where operator expected
# $code = 'my $x = this (STDOUT 123); 1';
# $expect = 'syntax error';
# show();


#----- special syntax for print and say

$code = 'print (STDOUT); 1';
$expect = '';
show();

$code = 'say STDOUT "# 123"; 1';
$expect = '';
show();

$code = 'say (STDOUT "# 123"); 1';
$expect = '';
show();

$code = 'my $x = say (STDOUT "# 123"); 1';
$expect = '';
show();


__END__

0 comments on commit b1a510b

Please sign in to comment.