Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lldb/packages/Python/lldbsuite/test/lldbtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,7 @@ def expect_expr(
result_value=None,
result_type=None,
result_children=None,
options=None,
):
"""
Evaluates the given expression and verifies the result.
Expand All @@ -2584,20 +2585,23 @@ def expect_expr(
:param result_type: The type that the expression result should have. None if the type should not be checked.
:param result_children: The expected children of the expression result
as a list of ValueChecks. None if the children shouldn't be checked.
:param options: Expression evaluation options. None if a default set of options should be used.
"""
self.assertTrue(
expr.strip() == expr,
"Expression contains trailing/leading whitespace: '" + expr + "'",
)

frame = self.frame()
options = lldb.SBExpressionOptions()

# Disable fix-its that tests don't pass by accident.
options.SetAutoApplyFixIts(False)
if not options:
options = lldb.SBExpressionOptions()

# Set the usual default options for normal expressions.
options.SetIgnoreBreakpoints(True)
# Disable fix-its that tests don't pass by accident.
options.SetAutoApplyFixIts(False)

# Set the usual default options for normal expressions.
options.SetIgnoreBreakpoints(True)

if self.frame().IsValid():
options.SetLanguage(frame.GuessLanguage())
Expand Down
Loading