Skip Menu |

This queue is for tickets about the POEx-Tickit CPAN distribution.

Report information
The Basics
Id: 122589
Status: open
Priority: 0/
Queue: POEx-Tickit

People
Owner: Nobody in particular
Requestors: anthony [...] derobert.net
SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.04
Fixed in: (no value)



Subject: No pass reports with Tickit 0.62 and later
On my smokers I see: ... Name "Tickit::on_mouse" used only once: possible typo at t/02input.t line 38. # Failed test 'on_mouse press(1) @20,10' # at t/02input.t line 100. # Structures begin differing at: # $got = undef # $expected = HASH(0x55c598988688) # Looks like you failed 1 test of 6. t/02input.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/6 subtests ... Statistical analysis shows that there are no pass reports with Tickit 0.62 and 0.63: <http://analysis.cpantesters.org/reports_by_field?SUBMIT_xxx=Submit&distv=POEx-Tickit-0.04&field=conf%3Aosname&field=mod%3ATickit>
Subject: Patch to work with Tickit 0.62 and later
(I hope I'm doing this right... infrequent user of RT) Below is a patch which gets the tests running again. As should be obvious, it's also available in git; that's at https://gitlab.com/derobert/poex-ticket/commit/eb547320b4ab608ce4594b30c0399ef4c42f1689 commit eb547320b4ab608ce4594b30c0399ef4c42f1689 Author: Anthony DeRobertis <anthony@derobert.net> Date: Fri Dec 20 11:56:35 2019 -0500 Fix test suite to work with newer Tickit. The test suite contained a kluge to get key events; later versions of Tickit broke the kluge but also added a way to do it. So switch to the new way; the tests pass now. diff --git a/t/02input.t b/t/02input.t index 037d68a..0ee46e4 100644 --- a/t/02input.t +++ b/t/02input.t @@ -26,22 +26,6 @@ my $tickit; my @key_events; my @mouse_events; -# We can't get at the key/mouse events easily from outside, so we'll hack it - -no warnings 'redefine'; -*Tickit::on_key = sub { - my ( $self, $keyev ) = @_; - push @key_events, { - map { $_ => $keyev->$_ } qw( type str mod ) - }; -}; -*Tickit::on_mouse = sub { - my ( $self, $mouseev ) = @_; - push @mouse_events, { - map { $_ => $mouseev->$_ } qw( type button line col mod ) - }; -}; - POE::Session->create( inline_states => { _start => sub { @@ -51,6 +35,19 @@ POE::Session->create( term_out => $term_wr, ); + $tickit->term->bind_event( key => sub { + my ( $self, $type, $info ) = @_; + push @key_events, { + map { $_ => $info->$_ } qw( type str mod ) + }; + }); + $tickit->term->bind_event( mouse => sub { + my ( $self, $type, $info ) = @_; + push @mouse_events, { + map { $_ => $info->$_ } qw( type button line col mod ) + } if 'mouse' eq $type; + }); + $_[KERNEL]->yield( test_keys => ); }, test_keys => sub {
Subject: poex-tickit.diff
commit eb547320b4ab608ce4594b30c0399ef4c42f1689 Author: Anthony DeRobertis <anthony@derobert.net> Date: Fri Dec 20 11:56:35 2019 -0500 Fix test suite to work with newer Tickit. The test suite contained a kluge to get key events; later versions of Tickit broke the kluge but also added a way to do it. So switch to the new way; the tests pass now. diff --git a/t/02input.t b/t/02input.t index 037d68a..0ee46e4 100644 --- a/t/02input.t +++ b/t/02input.t @@ -26,22 +26,6 @@ my $tickit; my @key_events; my @mouse_events; -# We can't get at the key/mouse events easily from outside, so we'll hack it - -no warnings 'redefine'; -*Tickit::on_key = sub { - my ( $self, $keyev ) = @_; - push @key_events, { - map { $_ => $keyev->$_ } qw( type str mod ) - }; -}; -*Tickit::on_mouse = sub { - my ( $self, $mouseev ) = @_; - push @mouse_events, { - map { $_ => $mouseev->$_ } qw( type button line col mod ) - }; -}; - POE::Session->create( inline_states => { _start => sub { @@ -51,6 +35,19 @@ POE::Session->create( term_out => $term_wr, ); + $tickit->term->bind_event( key => sub { + my ( $self, $type, $info ) = @_; + push @key_events, { + map { $_ => $info->$_ } qw( type str mod ) + }; + }); + $tickit->term->bind_event( mouse => sub { + my ( $self, $type, $info ) = @_; + push @mouse_events, { + map { $_ => $info->$_ } qw( type button line col mod ) + } if 'mouse' eq $type; + }); + $_[KERNEL]->yield( test_keys => ); }, test_keys => sub {