Skip to content

Commit ba1b52e

Browse files
committed
[mlir-lsp] Add outgoingNotification unit test
Add a unit test exercising `lsp::MessageHanlder::outgoingNotification`. Split off from pull request #90076, as requested.
1 parent 8dcb90b commit ba1b52e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,11 @@ TEST_F(TransportInputTest, MethodNotFound) {
118118
EXPECT_THAT(getOutput(), HasSubstr("\"error\""));
119119
EXPECT_THAT(getOutput(), HasSubstr("\"message\":\"method not found: ack\""));
120120
}
121+
122+
TEST_F(TransportInputTest, OutgoingNotification) {
123+
auto notifyFn = getMessageHandler().outgoingNotification<CompletionList>(
124+
"outgoing-notification");
125+
notifyFn(CompletionList{});
126+
EXPECT_THAT(getOutput(), HasSubstr("\"method\":\"outgoing-notification\""));
127+
}
121128
} // namespace

0 commit comments

Comments
 (0)