summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Burrows <Daniel Burrows Daniel_Burrows@alumni.brown.edu>2010-06-07 19:51:58 -0700
committerDaniel Burrows <Daniel Burrows Daniel_Burrows@alumni.brown.edu>2010-06-07 19:51:58 -0700
commite75e81ee4175cfbc788361be07bf71510e962388 (patch)
treee3dca84b779ff3a478749db912d2eab797138121 /tests
parente2f15e726af1aed60d304539b0c00feca714faba (diff)
downloadaptitude-e75e81ee4175cfbc788361be07bf71510e962388.tar.gz
Add a sanity-check to the terminal mock tests that makes the same calls a simple transient message would make.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_terminal_mock.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_terminal_mock.cc b/tests/test_terminal_mock.cc
index 90158853..ba303fd6 100644
--- a/tests/test_terminal_mock.cc
+++ b/tests/test_terminal_mock.cc
@@ -250,3 +250,25 @@ TEST_F(TerminalMock, CombineAndSplit)
terminal->write_text(L"lmn\nop");
terminal->flush();
}
+
+// Check that the transient message will work properly.
+TEST_F(TerminalMock, SimulatedTransientMessage)
+{
+ {
+ InSequence dummy;
+
+ EXPECT_CALL(*terminal, output(StrEq(L"\r\rabc")));
+ EXPECT_CALL(*terminal, output(StrEq(L"\r \ra")));
+ }
+
+ terminal->move_to_beginning_of_line();
+ terminal->move_to_beginning_of_line();
+ terminal->write_text(L"abc");
+ terminal->flush();
+
+ terminal->move_to_beginning_of_line();
+ terminal->write_text(L" ");
+ terminal->move_to_beginning_of_line();
+ terminal->write_text(L"a");
+ terminal->flush();
+}