[Lldb-commits] [lldb] [lldb] Add value to enumerator dump (PR #69815)
Vlad Serebrennikov via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 23 03:44:07 PDT 2023
================
@@ -23,9 +23,18 @@ def check_enum(self, suffix):
substrs=["Case1", "Case2", "Case3"],
)
# Test each case in the enum.
- self.expect_expr("var1_" + suffix, result_type=enum_name, result_value="Case1")
- self.expect_expr("var2_" + suffix, result_type=enum_name, result_value="Case2")
- self.expect_expr("var3_" + suffix, result_type=enum_name, result_value="Case3")
+ self.expect(
+ "expr var1_" + suffix,
+ patterns=[f"\\({enum_name}\\) \\$\\d+ = Case1\\(-?\\d+\\)"],
+ )
+ self.expect(
+ "expr var2_" + suffix,
+ patterns=[f"\\({enum_name}\\) \\$\\d+ = Case2\\(-?\\d+\\)"],
+ )
+ self.expect(
+ "expr var3_" + suffix,
+ patterns=[f"\\({enum_name}\\) \\$\\d+ = Case3\\(-?\\d+\\)"],
----------------
Endilll wrote:
I tried to do that initially, but then I realized that actual values of `Case1`, `Case2`, and `Case3` differ on invocations of this function. It might not be apparent at the first glance, but those asserts are a part of `check_enum` function which is called 10 times at the end of this file.
https://github.com/llvm/llvm-project/pull/69815
More information about the lldb-commits
mailing list