1 |
#!/usr/bin/perl |
2 |
use strict; |
3 |
use warnings; |
4 |
|
5 |
my $debug = shift @ARGV; |
6 |
|
7 |
use Test::More tests => 6; |
8 |
use Data::Dump qw/dump/; |
9 |
use blib; |
10 |
|
11 |
BEGIN { |
12 |
use_ok('Term::ISelect'); |
13 |
} |
14 |
|
15 |
my $lines = [ |
16 |
'first line', |
17 |
'{s}second selectable line', |
18 |
'', |
19 |
'last line', |
20 |
]; |
21 |
|
22 |
ok( my $iselect = Term::ISelect->new({ |
23 |
lines => $lines, |
24 |
debug => $debug, |
25 |
}), 'new' ); |
26 |
isa_ok( $iselect, 'Term::ISelect' ); |
27 |
|
28 |
diag "lines = ", dump( $iselect->lines ) if $debug; |
29 |
|
30 |
is_deeply( $iselect->lines, $lines, 'lines' ); |
31 |
|
32 |
ok( $iselect->open_screen, 'open_screen' ); |
33 |
system 'stty sane'; |
34 |
|
35 |
ok( my $l = $iselect->full_line( "foo bar" ), 'full_line' ); |
36 |
|
37 |
diag "full_line '$l'" if $debug; |
38 |
|