File: 02pending.t

package info (click to toggle)
libtickit-widget-entry-plugin-history-perl 0.01-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 124 kB
  • sloc: perl: 209; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 727 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/perl

use v5.14;
use warnings;

use Test::More;

use Tickit::Test;

use Tickit::Widget::Entry;
use Tickit::Widget::Entry::Plugin::History;

my $win = mk_window;

my $entry = Tickit::Widget::Entry->new;

my @history;
Tickit::Widget::Entry::Plugin::History->apply( $entry,
   storage => \@history,
);

push @history, qw( one two three );

$entry->set_window( $win );

flush_tickit;

presskey text => $_ for qw( a b c d );
flush_tickit;

is_display( [ "abcd" ], 'Display after initial typing' );

presskey key => "Up";
flush_tickit;

is_display( [ "three" ],
   'Display after history replay' );

presskey key => "Down";
flush_tickit;

is_display( [ "abcd" ],
   'Display after history replay cancel' );

done_testing;