# Force a hash recompute if this perl's internals can cache the hash key.
$key = "" . $key;
if (exists $orig->{$key}) {
- if ($orig->{$key} ne $value) {
+ if (
+ defined $orig->{$key} != defined $value
+ || (defined $value && $orig->{$key} ne $value)
+ ) {
_print "# key ", _qq($key), " was ", _qq($orig->{$key}),
" now ", _qq($value), "\n";
$fail = 1;
# The expected output may contain:
# OPTION list of options
# OPTIONS list of options
-# PREFIX
-# indicates that the supplied output is only a prefix to the
-# expected output
#
# The possible options for OPTION may be:
# regex - the expected output is a regular expression
# If the actual output contains a line "SKIPPED" the test will be
# skipped.
#
+# If the actual output contains a line "PREFIX", any output starting with that
+# line will be ignored when comparing with the expected output
+#
# If the global variable $FATAL is true then OPTION fatal is the
# default.
my $tmpfile = tempfile();
+ PROGRAM:
for (@prgs){
unless (/\n/) {
print "# From $_\n";
$reason{$what} = $temp;
}
}
+
my $name = '';
if ($prog =~ s/^#\s*NAME\s+(.+)\n//m) {
$name = $1;
}
+ if ($reason{skip}) {
+ SKIP:
+ {
+ skip($name ? "$name - $reason{skip}" : $reason{skip}, 1);
+ }
+ next PROGRAM;
+ }
+
if ($prog =~ /--FILE--/) {
my @files = split(/\n?--FILE--\s*([^\s\n]*)\s*\n/, $prog) ;
shift @files ;