[Mlir-commits] [mlir] ba1b52e - [mlir-lsp] Add `outgoingNotification` unit test

Brian Gesiak llvmlistbot at llvm.org
Thu Apr 25 12:35:04 PDT 2024


Author: Brian Gesiak
Date: 2024-04-25T15:33:55-04:00
New Revision: ba1b52e6e764ad637822f0b63d144eca6e5d5627

URL: https://github.com/llvm/llvm-project/commit/ba1b52e6e764ad637822f0b63d144eca6e5d5627
DIFF: https://github.com/llvm/llvm-project/commit/ba1b52e6e764ad637822f0b63d144eca6e5d5627.diff

LOG: [mlir-lsp] Add `outgoingNotification` unit test

Add a unit test exercising `lsp::MessageHanlder::outgoingNotification`.
Split off from pull request #90076, as requested.

Added: 
    

Modified: 
    mlir/unittests/Tools/lsp-server-support/Transport.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/unittests/Tools/lsp-server-support/Transport.cpp b/mlir/unittests/Tools/lsp-server-support/Transport.cpp
index 48eae32a0fc3a4..b46f02bc4b197b 100644
--- a/mlir/unittests/Tools/lsp-server-support/Transport.cpp
+++ b/mlir/unittests/Tools/lsp-server-support/Transport.cpp
@@ -118,4 +118,11 @@ TEST_F(TransportInputTest, MethodNotFound) {
   EXPECT_THAT(getOutput(), HasSubstr("\"error\""));
   EXPECT_THAT(getOutput(), HasSubstr("\"message\":\"method not found: ack\""));
 }
+
+TEST_F(TransportInputTest, OutgoingNotification) {
+  auto notifyFn = getMessageHandler().outgoingNotification<CompletionList>(
+      "outgoing-notification");
+  notifyFn(CompletionList{});
+  EXPECT_THAT(getOutput(), HasSubstr("\"method\":\"outgoing-notification\""));
+}
 } // namespace


        


More information about the Mlir-commits mailing list