2 Make sure the !N and !-N commands work properly.
5 from __future__ import print_function
12 import lldbsuite.test.lldbutil as lldbutil
13 from lldbsuite.test.lldbtest import *
16 class TestHistoryRecall(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
20 # If your test case doesn't stress debug info, the
21 # set this to true. That way it won't be run once for
22 # each debug info format.
23 NO_DEBUG_INFO_TESTCASE = True
25 def test_history_recall(self):
26 """Test the !N and !-N functionality of the command interpreter."""
30 # Call super's setUp().
33 def sample_test(self):
34 interp = self.dbg.GetCommandInterpreter()
35 result = lldb.SBCommandReturnObject()
36 interp.HandleCommand("command history", result, True)
37 interp.HandleCommand("platform list", result, True)
39 interp.HandleCommand("!0", result, False)
40 self.assertTrue(result.Succeeded(), "!0 command did not work: %s"%(result.GetError()))
41 self.assertTrue("command history" in result.GetOutput(), "!0 didn't rerun command history")
43 interp.HandleCommand("!-1", result, False)
44 self.assertTrue(result.Succeeded(), "!-1 command did not work: %s"%(result.GetError()))
45 self.assertTrue("host:" in result.GetOutput(), "!-1 didn't rerun platform list.")