summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2008-05-24 17:50:42 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2008-05-24 17:50:42 -0500
commit937403fd61db43b46d8435a094d049486f55a991 (patch)
treef9c3ca4122f1c9944216e8a037db4075303fbcd7
parent57e912eefc5bebd9b0f9f4dcaa53689620965f8d (diff)
downloadlanguage-teco-937403fd61db43b46d8435a094d049486f55a991.tar.gz
language-teco-937403fd61db43b46d8435a094d049486f55a991.zip
add a test for the = command
-rw-r--r--t/023-numeric-printing.t28
1 files changed, 28 insertions, 0 deletions
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");