Jonas Brømsø Nielsen wrote:
Hi Burak,
Is there a general module to do this to begin with?
Then making a Test::* wrapper is trivial
I do however think that Test::File::EOL would be a better name.
jonasbn
On 11/01/2008, at 23.42, Burak Gürsoy wrote:
I think that something like this can be useful when packing distros. I
end-up with mixed eol (not in the same file) most of the time:
use Test::EOL;
eol('lib/Foo/Bar.pm', 'LF');
eol('lib/Foo/Bar.pm', 'Unix');
eol_is_mixed('lib/Foo/Bar.pm');
eol_is_mixed('lib/Foo/Bar.pm', [qw/ LF CRLF /]);
eol_isnt_mixed('lib/Foo/Bar.pm');
all_eol('Unix');
all_eol_isnt_mixed();
# etc.
(in case I missed it) is there a module to run this kind of tests?
Rather than solve this via testing (for the "dist files" case) I just
run (or rather, my release script runs) File::LocalizeNewlines over the
dist directory before packaging.
Adam K