Skip to content

Commit 53d6e59

Browse files
committed
[lldb] Check the command string in TestCommandInterepterPrintCallback
Now that we store the command in the CommandReturnObject (#125132) we can check the command in the print callback.
1 parent 560e372 commit 53d6e59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/test/API/python_api/interpreter_callback/TestCommandInterepterPrintCallback.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_command_interpreter_print_callback(self):
3838
def handling_callback(return_object):
3939
nonlocal called
4040
called = True
41+
self.assertEqual("help help", return_object.GetCommand())
4142
self.assertIn(needle, return_object.GetOutput())
4243
return lldb.eCommandReturnObjectPrintCallbackHandled
4344

@@ -53,13 +54,14 @@ def handling_callback(return_object):
5354
def non_handling_callback(return_object):
5455
nonlocal called
5556
called = True
57+
self.assertEqual("he help", return_object.GetCommand())
5658
self.assertIn(needle, return_object.GetOutput())
5759
return lldb.eCommandReturnObjectPrintCallbackSkipped
5860

5961
called = False
6062
ci.SetPrintCallback(non_handling_callback)
6163
self.assertFalse(called)
62-
self.run_command_interpreter_with_output_file(out_filename, "help help\n")
64+
self.run_command_interpreter_with_output_file(out_filename, "he help\n")
6365
self.assertTrue(called)
6466

6567
with open(out_filename, "r") as f:

0 commit comments

Comments
 (0)