diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-04-14 08:52:04 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-04-14 08:52:04 -0500 |
commit | 1db37bb0163fbb33801f8f66ba409a8202137508 (patch) | |
tree | 0b608aaf976f097f63d65204a457ded3b9f006b3 /t/02-read-write.t | |
parent | fddf32a172ddc7588fa8818938b17e468ae9de09 (diff) | |
download | app-termcast-1db37bb0163fbb33801f8f66ba409a8202137508.tar.gz app-termcast-1db37bb0163fbb33801f8f66ba409a8202137508.zip |
override termsize calculation in tests, so it is consistent
Diffstat (limited to 't/02-read-write.t')
-rw-r--r-- | t/02-read-write.t | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/t/02-read-write.t b/t/02-read-write.t index b7a26ac..0979955 100644 --- a/t/02-read-write.t +++ b/t/02-read-write.t @@ -20,6 +20,11 @@ test_tcp( my $client_script = <<EOF; BEGIN { \@INC = split /:/, '$inc' } use App::Termcast; + + no warnings 'redefine'; + local *App::Termcast::_termsize = sub { return (80, 24) }; + use warnings 'redefine'; + my \$tc = App::Termcast->new( host => '127.0.0.1', port => $port, user => 'test', password => 'tset'); @@ -69,8 +74,9 @@ EOF { sysread($sread, my $buf, 1) } my $login; $client->recv($login, 4096); - my $auth_regexp = qr/^hello test tset\n(?:\e\[H\x00.+?\xff\e\[H\e\[2J)?/; - like($login, $auth_regexp, 'got the correct login info'); + is($login, + "hello test tset\n\e\[H\x00{\"geometry\":[80,24]}\xff\e\[H\e\[2J", + "got the correct login info"); $client->send("hello, test\n"); syswrite($swrite, 'a'); |