Skip to content

Commit ddd6104

Browse files
committed
Check prefix matching in the test
1 parent ae1eb0e commit ddd6104

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lldb/test/API/commands/command/language/TestFrameLanguageCommands.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,30 @@ def test(self):
1414
frame = thread.selected_frame
1515
self.assertEqual(frame.GuessLanguage(), lldb.eLanguageTypeC_plus_plus_11)
1616
self.assertEqual(frame.name, "f()")
17+
18+
# Test `help`.
1719
self.expect(
1820
"help demangle",
1921
substrs=[
2022
"Demangle a C++ mangled name.",
2123
"Syntax: language cplusplus demangle [<mangled-name> ...]",
2224
],
2325
)
24-
self.expect("demangle _Z1fv", startstr="_Z1fv ---> f()")
2526

26-
# Switch the objc caller.
27+
# Run a `language cplusplus` command.
28+
self.expect(f"demangle _Z1fv", startstr="_Z1fv ---> f()")
29+
# Test prefix matching.
30+
self.expect("dem _Z1fv", startstr="_Z1fv ---> f()")
31+
32+
# Select the objc caller.
2733
self.runCmd("up")
2834
frame = thread.selected_frame
2935
self.assertEqual(frame.GuessLanguage(), lldb.eLanguageTypeObjC_plus_plus)
3036
self.assertEqual(frame.name, "main")
37+
38+
# Ensure `demangle` doesn't resolve from the objc frame.
3139
self.expect("help demangle", error=True)
32-
self.expect(
33-
"help tagged-pointer",
34-
substrs=[
35-
"Commands for operating on Objective-C tagged pointers.",
36-
"Syntax: class-table <subcommand> [<subcommand-options>]",
37-
],
38-
)
40+
# Run a `language objc` command.
3941
self.expect(
4042
"tagged-pointer info 0",
4143
error=True,

0 commit comments

Comments
 (0)