summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Burrows <Daniel Burrows Daniel_Burrows@alumni.brown.edu>2010-06-07 18:59:16 -0700
committerDaniel Burrows <Daniel Burrows Daniel_Burrows@alumni.brown.edu>2010-06-07 18:59:16 -0700
commite2f15e726af1aed60d304539b0c00feca714faba (patch)
tree4887c982dc49eebf0b03543cb276fc628ec1e748 /tests
parent7c3e137bc6556db858e5657c8d13e9df6756b849 (diff)
downloadaptitude-e2f15e726af1aed60d304539b0c00feca714faba.tar.gz
Write one test to specifically verify that the sequence of characters sent by the transient message has the effect that it should.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_teletype_mock.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_teletype_mock.cc b/tests/test_teletype_mock.cc
index 3c1ba905..1d1ba43e 100644
--- a/tests/test_teletype_mock.cc
+++ b/tests/test_teletype_mock.cc
@@ -138,6 +138,23 @@ TEST_F(TeletypeTest, testOutputLine)
term->flush();
}
+// Imitates what the transient message does, to be sure that it will
+// behave as expected if it outputs the right thing.
+TEST_F(TeletypeTest, OverwriteABCWithA)
+{
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(*teletype, set_last_line(StrEq(L"abc")));
+ EXPECT_CALL(*teletype, set_last_line(StrEq(L"a ")));
+ }
+
+ term->output(L"abc");
+ term->flush();
+ term->output(L"\r \ra");
+ term->flush();
+}
+
TEST_F(TeletypeTest, testOverwriteOneCharAtATime)
{
{