[Lldb-commits] [lldb] [lldb] Add actionable feedback when overwriting a command fails (PR #76030)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 20 02:50:38 PST 2023


================
@@ -161,6 +161,17 @@ def cleanup():
         )
         self.expect("my_command", substrs=["a.out"])
 
+        # Test that without --overwrite we are not allowed to redefine the command.
+        self.expect(
+            "command script add my_command --class welcome.TargetnameCommand",
+            substrs=[
+                "cannot add command: user command exists and force replace not set",
+                "--overwrite",
+                "settings set interpreter.require-overwrite false",
----------------
felipepiovezan wrote:

My original intent was to test that "overwrite" and "settings set..." were mentioned mentioned _somewhere_ in the message, without having to change the test in case someone tweaks the fine print in the future. But I'll update it and just check the whole message, one can argue that if someone changes the fine print it should cause the test to fail.

https://github.com/llvm/llvm-project/pull/76030


More information about the lldb-commits mailing list