This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add perldelta entry for 8a384d3a99 (ParseXS and locales).
[perl5.git] / t / op / yadayada.t
CommitLineData
be25f609 1#!./perl
2
341b7876
NC
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6 require './test.pl';
7}
be25f609 8
341b7876
NC
9use strict;
10
29e8de64 11plan 5;
341b7876
NC
12
13my $err = "Unimplemented at $0 line " . ( __LINE__ + 2 ) . ".\n";
be25f609 14
15eval { ... };
16
341b7876 17is $@, $err;
29e8de64
A
18
19
20#
21# Regression tests, making sure ... is still parsable as an operator.
22#
23my @lines = split /\n/ => <<'--';
24
25# Check simple range operator.
26my @arr = 'A' ... 'D';
27
28# Range operator with print.
29print 'D' ... 'A';
30
31# Without quotes, 'D' could be a file handle.
32print D ... A ;
33
34# Another possible interaction with a file handle.
35print ${\"D"} ... A ;
36--
37
38foreach my $line (@lines) {
39 next if $line =~ /^\s*#/ || $line !~ /\S/;
40 my $mess = qq {Parsing '...' in "$line" as a range operator};
41 eval qq {
42 {local *STDOUT; no strict "subs"; $line;}
43 pass \$mess;
44 1;
45 } or do {
46 my $err = $@;
47 $err =~ s/\n//g;
48 fail "$mess ($err)";
49 }
50}