- Document how to add perltidy markers via filter_generated_code
- Fix DB2 foreign-key introspection
- Remove dependency on List::MoreUtils and Sub::Name
+ - Ensure schema files are generated as binary files on Windows
0.07042 2014-08-20
- Fix unescaped left braces in regexes in tests
$self->omit_timestamp ? undef : POSIX::strftime('%Y-%m-%d %H:%M:%S', localtime)
);
- open(my $fh, '>:encoding(UTF-8)', $filename)
+ open(my $fh, '>:raw:encoding(UTF-8)', $filename)
or croak "Cannot open '$filename' for writing: $!";
# Write the top half and its MD5 sum
}
}
-sub _dump_file_like {
+sub _slurp {
my $path = shift;
- open(my $dumpfh, '<', $path) or die "Failed to open '$path': $!";
+ open(my $dumpfh, '<:raw', $path) or die "Failed to open '$path': $!";
my $contents = do { local $/; <$dumpfh>; };
close($dumpfh);
+ return ($path, $contents);
+}
+
+sub _dump_file_like {
+ my ($path, $contents) = _slurp shift;
like($contents, $_, "$path matches $_") for @_;
}
sub _dump_file_not_like {
- my $path = shift;
- open(my $dumpfh, '<', $path) or die "Failed to open '$path': $!";
- my $contents = do { local $/; <$dumpfh>; };
- close($dumpfh);
+ my ($path, $contents) = _slurp shift;
unlike($contents, $_, "$path does not match $_") for @_;
}