#!./perl -w
BEGIN {
chdir 't' if -d 't';
print "1..0\n";
exit 0;
}
}
use POSIX;
use strict ;
# E.g. \t might or might not be isprint() depending on the locale,
# so let's reset to the default.
$| = 1;
# List of characters (and strings) to feed to the is<xxx> functions.
#
# The left-hand side (key) is a character or string.
# The right-hand side (value) is a list of character classes to which
# this string belongs. This is a *complete* list: any classes not
# listed, are expected to return '0' for the given string.
my %classes =
(
# Multi-character strings. These are logically ANDed, so the
# presence of different types of chars in one string will
# reduce the list on the right.
"abcde\001" => [],
# An empty string. Always true (al least in old days) [bug #24554]
);
# Pass 1: convert the above arrays to hashes. While doing so, obtain
# a complete list of all the 'is<xxx>' functions. At least, the ones
# listed above.
my %functions;
"is$_" => 1; # Our return value: is<xxx>($s) should pass.
} @{$classes{$s}} };
}
# Expected number of tests is one each for every combination of a
# known is<xxx> function and string listed above.
#
# Main test loop: Run all POSIX::is<xxx> tests on each string defined above.
# Only the character classes listed for that string should return 1. We
# always run all functions on every string, and expect to get 0 for the
# character classes not listed in the given string's hash value.
#
}
}