From 937403fd61db43b46d8435a094d049486f55a991 Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Sat, 24 May 2008 17:50:42 -0500 Subject: add a test for the = command --- t/023-numeric-printing.t | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t/023-numeric-printing.t diff --git a/t/023-numeric-printing.t b/t/023-numeric-printing.t new file mode 100644 index 0000000..c966b83 --- /dev/null +++ b/t/023-numeric-printing.t @@ -0,0 +1,28 @@ +#!perl -T +use strict; +use warnings; +use Test::More; +use Language::TECO; + +my %tests = ( + "15=" => "15\n", + "15==" => "17\n", + "15:=" => "15", + "15:==" => "17", + "-15=" => "-15\n", + "-15==" => "37777777761\n", + "-15:=" => "-15", + "-15:==" => "37777777761", + "b=" => "0", +); +plan tests => 3 + keys %tests; + +my $buftext = "this is\nan initial buffer"; +my $te = Language::TECO->new($buftext); +for my $test (keys %tests) { + is($te->execute($test), $tests{$test}, "\"$test\""); +} +is($te->execute(".="), 0, "current position"); +$te->execute("5j"); +is($te->execute(".="), 5, "current position"); +is($te->execute("z="), 25, "end of buffer"); -- cgit v1.2.3