aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/API/commands')
-rw-r--r--lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py20
-rw-r--r--lldb/test/API/commands/protocol/TestMCPUnixSocket.py13
2 files changed, 30 insertions, 3 deletions
diff --git a/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py b/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py
index 0cc505a..ec208f2 100644
--- a/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py
+++ b/lldb/test/API/commands/expression/diagnostics/TestExprDiagnostics.py
@@ -215,8 +215,22 @@ note: candidate function not viable: requires single argument 'x', but 2 argumen
details = diags.GetValueForKey("details")
- # Detail 1/2: undeclared 'a'
+ # Detail 1/3: note: requested expression language
diag = details.GetItemAtIndex(0)
+ self.assertEqual(str(diag.GetValueForKey("severity")), "note")
+ self.assertEqual(
+ str(diag.GetValueForKey("message")), "Ran expression as 'C++11'."
+ )
+ self.assertEqual(
+ str(diag.GetValueForKey("rendered")), "Ran expression as 'C++11'."
+ )
+ self.assertEqual(str(diag.GetValueForKey("source_location")), "")
+ self.assertEqual(str(diag.GetValueForKey("file")), "")
+ self.assertFalse(diag.GetValueForKey("hidden").GetBooleanValue())
+ self.assertFalse(diag.GetValueForKey("in_user_input").GetBooleanValue())
+
+ # Detail 2/3: undeclared 'a'
+ diag = details.GetItemAtIndex(1)
severity = diag.GetValueForKey("severity")
message = diag.GetValueForKey("message")
@@ -234,8 +248,8 @@ note: candidate function not viable: requires single argument 'x', but 2 argumen
self.assertFalse(hidden.GetBooleanValue())
self.assertTrue(in_user_input.GetBooleanValue())
- # Detail 1/2: undeclared 'b'
- diag = details.GetItemAtIndex(1)
+ # Detail 3/3: undeclared 'b'
+ diag = details.GetItemAtIndex(2)
message = diag.GetValueForKey("message")
self.assertIn("undeclared identifier 'b'", str(message))
diff --git a/lldb/test/API/commands/protocol/TestMCPUnixSocket.py b/lldb/test/API/commands/protocol/TestMCPUnixSocket.py
index ea9255c..9edb97e 100644
--- a/lldb/test/API/commands/protocol/TestMCPUnixSocket.py
+++ b/lldb/test/API/commands/protocol/TestMCPUnixSocket.py
@@ -32,3 +32,16 @@ class MCPUnixSocketCommandTestCase(TestBase):
startstr="MCP server started with connection listeners:",
substrs=[f"unix-connect://{socket_file}"],
)
+
+ self.expect(
+ "protocol-server get MCP",
+ startstr="MCP server connection listeners:",
+ substrs=[f"unix-connect://{socket_file}"],
+ )
+
+ self.runCmd("protocol-server stop MCP", check=False)
+ self.expect(
+ "protocol-server get MCP",
+ error=True,
+ substrs=["MCP server is not running"],
+ )