Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[rt.cpan.org 53519] The issue was a disagreement in the interpretatio…
…n of "\n" on Windows (DOS newline semantics). Changed the newline charater to "!", because I can.
  • Loading branch information
rcaputo committed Jan 14, 2010
1 parent 5b850dc commit a73e2ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions t/90_regression/bingos-followtail.t
Expand Up @@ -6,14 +6,15 @@ use strict;
sub POE::Kernel::ASSERT_DEFAULT () { 1 }

use IO::Handle;
use POE qw(Wheel::FollowTail);
use POE qw(Wheel::FollowTail Filter::Line);
use Test::More tests => 2;

my $filename = 'bingos-followtail';

# Using "!" as a newline to avoid differences in opinion about "\n".
open FH, ">$filename" or die "$!\n";
FH->autoflush(1);
print FH "moocow - this line should be skipped\n";
print FH "moocow - this line should be skipped!";

POE::Session->create(
package_states => [
Expand All @@ -31,13 +32,13 @@ exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
$heap->{wheel} = POE::Wheel::FollowTail->new(
Filter => POE::Filter::Line->new( Literal => "\n" ),
Filter => POE::Filter::Line->new( Literal => "!" ),
Filename => $heap->{filename},
InputEvent => '_input',
ErrorEvent => '_error',
);
$heap->{counter} = 0;
print FH "Cows go moo, yes they do\n";
print FH "Cows go moo, yes they do!";
close FH;
return;
}
Expand Down

0 comments on commit a73e2ba

Please sign in to comment.