(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 {