| 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 |
|
|---|
| 10 | BEGIN {
|
|---|
| 11 | chdir 't' if -d 't';
|
|---|
| 12 | @INC = '../lib';
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | use strict;
|
|---|
| 16 |
|
|---|
| 17 | $_ = ''; # to avoid undef warning on m// etc.
|
|---|
| 18 |
|
|---|
| 19 | sub 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 |
|
|---|
| 27 | print "1..25\n";
|
|---|
| 28 |
|
|---|
| 29 | ok 1, (eval "package ABC; sub zyx {1}; 1;" and
|
|---|
| 30 | eval "ABC::zyx" and
|
|---|
| 31 | not eval "ABC:: eq ABC||" and
|
|---|
|
|---|