Hi Burak,
Writing a Test::Module as you proposed is not a bad idea, nobody says
you have to distribute it via CPAN, you could just scratch your own
itch writing a TAP compliant module
wrapping File::LocalizeNewlines.
IMHO all tests can be written using basic Perl, but test modules just
gives you better syntax.
jonasbn
On 20/01/2008, at 23.05, Burak Gürsoy wrote:
File::LocalizeNewlines seems promising :) I didn't notice that
module before
though :p
I do however think that Test::File::EOL would be a better name.
Perhaps you misunderstood me, I don't want to write this module,
just want
to use it :)
-----Original Message-----
From: Adam Kennedy [mailto:[EMAIL PROTECTED]
Sent: Friday, January 18, 2008 10:28 AM
To: [email protected]; Jonas Brømsø Nielsen
Cc: Burak Gürsoy; [email protected]
Subject: Re: Is there a test module to check eol() in dist files?
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