# grep() and map() tests
#
-print "1..3\n";
+print "1..27\n";
$test = 1;
$test++;
}
+{
+ print map({$_} ("ok $test\n"));
+ $test++;
+ print map
+ ({$_} ("ok $test\n"));
+ $test++;
+ print((map({a => $_}, ("ok $test\n")))[0]->{a});
+ $test++;
+ print((map
+ ({a=>$_},
+ ("ok $test\n")))[0]->{a});
+ $test++;
+ print map { $_ } ("ok $test\n");
+ $test++;
+ print map
+ { $_ } ("ok $test\n");
+ $test++;
+ print((map {a => $_}, ("ok $test\n"))[0]->{a});
+ $test++;
+ print((map
+ {a=>$_},
+ ("ok $test\n"))[0]->{a});
+ $test++;
+ my $x = "ok \xFF\xFF\n";
+ print map($_&$x,("ok $test\n"));
+ $test++;
+ print map
+ ($_ & $x, ("ok $test\n"));
+ $test++;
+ print map { $_ & $x } ("ok $test\n");
+ $test++;
+ print map
+ { $_&$x } ("ok $test\n");
+ $test++;
+
+ print grep({$_} ("ok $test\n"));
+ $test++;
+ print grep
+ ({$_} ("ok $test\n"));
+ $test++;
+ print grep({a => $_}->{a}, ("ok $test\n"));
+ $test++;
+ print grep
+ ({a => $_}->{a},
+ ("ok $test\n"));
+ $test++;
+ print grep { $_ } ("ok $test\n");
+ $test++;
+ print grep
+ { $_ } ("ok $test\n");
+ $test++;
+ print grep {a => $_}->{a}, ("ok $test\n");
+ $test++;
+ print grep
+ {a => $_}->{a},
+ ("ok $test\n");
+ $test++;
+ print grep($_&"X",("ok $test\n"));
+ $test++;
+ print grep
+ ($_&"X", ("ok $test\n"));
+ $test++;
+ print grep { $_ & "X" } ("ok $test\n");
+ $test++;
+ print grep
+ { $_ & "X" } ("ok $test\n");
+ $test++;
+}
Rop(OP_SGE);
case KEY_grep:
- LOP(OP_GREPSTART, *s == '(' ? XTERM : XREF);
+ LOP(OP_GREPSTART, XREF);
case KEY_goto:
s = force_word(s,WORD,TRUE,FALSE,FALSE);
TERM(sublex_start());
case KEY_map:
- LOP(OP_MAPSTART, *s == '(' ? XTERM : XREF);
+ LOP(OP_MAPSTART, XREF);
case KEY_mkdir:
LOP(OP_MKDIR,XTERM);