summaryrefslogtreecommitdiffstats
path: root/t/030-buffer-positions.t
blob: c223139e14216f946d653c950eb0aab31e04c666 (plain) (blame)
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
#!perl -T
use strict;
use warnings;
use Test::More tests => 9;
use Language::TECO;

my $buftext = "this is\nan initial buffer";
my $te = Language::TECO->new($buftext);
$te->execute("5j");
is($te->pointer, 5);
$te->execute("bj");
is($te->pointer, 0);
$te->execute("zj");
is($te->pointer, length $buftext);
$te->execute("5j");
$te->execute("-.d");
is($te->pointer, 0);
is($te->buffer, "is\nan initial buffer");
$te->execute("1,6d");
is($te->buffer, "iinitial buffer");
$te->execute("b,.d");
is($te->buffer, "initial buffer");
$te->execute("5j");
$te->execute(".,zd");
is($te->buffer, "initi");
$te->execute("hd");
is($te->buffer, "");