#!./perl
#
# Ensure that syntax using colons (:) is parsed correctly.
# The tests are done on the following tokens (by default):
# ABC LABEL XYZZY m q qq qw qx s tr y AUTOLOAD and alarm
# -- Robin Barker <rmb@cise.npl.co.uk>
#
chdir 't' if -d 't';
}
$_ = ''; # to avoid undef warning on m// etc.
}
print "1..25\n";
ok 1,
(eval "package ABC; sub zyx {1}; 1;" and
ok 2,
(eval "package LABEL; sub zyx {1}; 1;" and not eval "LABEL:: eq LABEL||" and not eval "LABEL::: >= 0");
ok 3,
(eval "package XYZZY; sub zyx {1}; 1;" and not eval "XYZZY:: eq XYZZY||" and not eval "XYZZY::: >= 0");
ok 4,
(eval "package m; sub zyx {1}; 1;" and
ok 5,
(eval "package q; sub zyx {1}; 1;" and
ok 6,
(eval "package qq; sub zyx {1}; 1;" and
ok 7,
(eval "package qw; sub zyx {1}; 1;" and
ok 8,
(eval "package qx; sub zyx {1}; 1;" and
ok 9,
(eval "package s; sub zyx {1}; 1;" and eval "s::: >= 0");
ok 10,
(eval "package tr; sub zyx {1}; 1;" and eval "tr::: >= 0");
ok 11,
(eval "package y; sub zyx {1}; 1;" and eval "y::: >= 0");
not eval "ABC:echo: eq ABC|echo|" and not eval "ABC:echo:ohce: >= 0");
ok 13,
(eval "LABEL:1" and not eval "LABEL:echo: eq LABEL|echo|" and not eval "LABEL:echo:ohce: >= 0");
ok 14,
(eval "XYZZY:1" and not eval "XYZZY:echo: eq XYZZY|echo|" and not eval "XYZZY:echo:ohce: >= 0");
eval "m:echo: eq m|echo|" and not eval "m:echo:ohce: >= 0");
eval "q:echo: eq q|echo|" and not eval "q:echo:ohce: >= 0");
eval "qq:echo: eq qq|echo|" and not eval "qq:echo:ohce: >= 0");
eval "qw:echo: eq qw|echo|" and not eval "qw:echo:ohce: >= 0");
eval "qx:echo 1: eq qx|echo 1|" and # echo without args may warn not eval "qx:echo:ohce: >= 0");
not eval "s:echo: eq s|echo|" and eval "s:echo:ohce: >= 0");
not eval "tr:echo: eq tr|echo|" and eval "tr:echo:ohce: >= 0");
not eval "y:echo: eq y|echo|" and eval "y:echo:ohce: >= 0");
ok 23,
(eval "AUTOLOAD:1" and not eval "AUTOLOAD:echo: eq AUTOLOAD|echo|" and not eval "AUTOLOAD:echo:ohce: >= 0");
not eval "and:echo: eq and|echo|" and not eval "and:echo:ohce: >= 0");
ok 25,
(eval "alarm:1" and not eval "alarm:echo: eq alarm|echo|" and not eval "alarm:echo:ohce: >= 0");