source: trunk/essentials/dev-lang/perl/t/comp/colon.t@ 3315

Last change on this file since 3315 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 3.2 KB
Line 
1#!./perl
2
3#
4# Ensure that syntax using colons (:) is parsed correctly.
5# The tests are done on the following tokens (by default):
6# ABC LABEL XYZZY m q qq qw qx s tr y AUTOLOAD and alarm
7# -- Robin Barker <[email protected]>
8#
9
10BEGIN {
11 chdir 't' if -d 't';
12 @INC = '../lib';
13}
14
15use strict;
16
17$_ = ''; # to avoid undef warning on m// etc.
18
19sub ok {
20 my($test,$ok) = @_;
21 print "not " unless $ok;
22 print "ok $test\n";
23}
24
25$SIG{__WARN__} = sub { 1; }; # avoid some spurious warnings
26
27print "1..25\n";
28
29ok 1, (eval "package ABC; sub zyx {1}; 1;" and
30 eval "ABC::zyx" and
31 not eval "ABC:: eq ABC||" and