File: 08common.t

package info (click to toggle)
libcurses-ui-perl 0.9609-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,312 kB
  • sloc: perl: 12,464; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 977 bytes parent folder | download | duplicates (4)
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
use Test::More tests => 9;

use strict;
use FindBin;
use lib "$FindBin::RealBin/fakelib";

$ENV{LINES} = 25;
$ENV{COLUMNS} = 80;

BEGIN { use_ok( "Curses::UI");
	use_ok( "Curses::UI::Common"); }

# initialize
my $cui = new Curses::UI("-clear_on_exit" => 0);
$cui->leave_curses();
isa_ok($cui, "Curses::UI");

# create window
my $mainw = $cui->add("testw","Window");
isa_ok($mainw, "Curses::UI::Window");

# misc original tests
ok($mainw->root eq $cui, "root()");
my $data = { KEY => "value", FOO => "bar"  };
Curses::UI::Common::keys_to_lowercase($data);
is ($data->{key}, 'value', "keys_to_lowercase 1");
is ($data->{foo}, 'bar', "keys_to_lowercase 2");

#-------------------------------------------------------------------- scrlength
is (Curses::UI::Common::scrlength("foo bar"),
    length("foo bar"), "scrlength == 7");
isnt (Curses::UI::Common::scrlength("foo\tbar"),
      length("foo bar"), "scrlength > 7");


## TODO:
## split_to_lines
## text_dimension
## wrap stuff