1 |
#!/usr/bin/perl |
2 |
use warnings; |
3 |
use strict; |
4 |
|
5 |
use Test::More tests => 9; |
6 |
|
7 |
use Term::Emulator::Parser; |
8 |
|
9 |
my $term = Term::Emulator::Parser->new(width => 5, height => 2); |
10 |
|
11 |
$term->parse("abc"); |
12 |
is($term->as_string, "abc \n "); |
13 |
$term->parse("def"); |
14 |
is($term->as_string, "abcde\nf "); |
15 |
$term->parse("gh"); |
16 |
is($term->as_string, "abcde\nfgh "); |
17 |
$term->parse("ijklmn"); |
18 |
is($term->as_string, "fghij\nklmn "); |
19 |
$term->parse("opq\012rst"); |
20 |
is($term->as_string, "pq \nrst "); |
21 |
$term->parse("\015uv"); |
22 |
is($term->as_string, "pq \nuvt "); |
23 |
$term->parse("\010w"); |
24 |
is($term->as_string, "pq \nuwt "); |
25 |
$term->parse("\010\010x"); |
26 |
is($term->as_string, "pq \nxwt "); |
27 |
$term->parse("\010\010y"); |
28 |
is($term->as_string, "pq \nywt "); |
29 |
|