# $Id: parselink.t,v 1.1 2001/11/23 10:09:06 eagle Exp $
#
# parselink.t -- Tests for Pod::ParseLink.
#
# Copyright 2001 by Russ Allbery <rra@stanford.edu>
#
# under the same terms as Perl itself.
# The format of each entry in this array is the L<> text followed by the
# five-element parse returned by parselink. When adding a new test, also
# increment the test count in the BEGIN block below. We don't use any of the
# fancy test modules intentionally for backward compatibility to older
# versions of Perl.
@TESTS = (
[ 'foo',
[ 'foo|bar',
[ 'foo/"baz boo"',
[ '/bar',
[ '/"baz boo"',
[ '/baz boo',
[ 'foo bar / baz boo',
[ "foo\nbar\nbaz\n/\nboo",
'anchor', 'anchor', 'name', 'section', 'pod' ],
[ '"boo var baz"',
[ 'bar baz',
[ '"boo bar baz / baz boo"',
'pod' ],
[ 'fooZ<>bar',
'Testing I<italics>', 'Testing I<italics>', 'foo', 'bar', 'pod' ],
[ 'foo/I<Italic> text',
[ 'fooE<verbar>barZ<>/Section C<with> I<B<other> markup',
'fooE<verbar>barZ<>', 'Section C<with> I<B<other> markup', 'pod' ],
[ 'ls(1)',
[ ' perlfunc(1)/open ',
[ 'some manual page|perl(1)',
[ 'news:yld72axzc8.fsf@windlord.stanford.edu',
);
BEGIN {
chdir 't' if -d 't';
$| = 1;
print "1..25\n";
}
END {
}
$loaded = 1;
print "ok 1\n";
# Used for reporting test failures.
my $n = 2;
for (@TESTS) {
my @expected = @$_;
my $okay = 1;
for (0..4) {
# Make sure to check undef explicitly; we don't want undef to match
# the empty string because they're semantically different.
$okay = 0;
}
}
$n++;
}