Skip to content

Commit 2ebf7ae

Browse files
committed
Add a "mark" function to write to stdout and the test log
For correlating with circleci logs
1 parent fd28518 commit 2ebf7ae

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

test/functional/PluginSpec.hs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,20 @@ import TestUtils
2626

2727
-- ---------------------------------------------------------------------
2828

29+
-- | Put a text marker on stdout in the client and the server log
30+
mark :: String -> Session ()
31+
mark str = do
32+
sendNotification (CustomClientMethod "$/testid") (T.pack str)
33+
liftIO $ putStrLn str
34+
35+
-- ---------------------------------------------------------------------
36+
2937
spec :: Spec
3038
spec = do
3139
describe "composes code actions" $
3240
it "provides 3.8 code actions" $ runSession hieCommandExamplePlugin fullCaps "test/testdata" $ do
3341

34-
-- sendNotification (CustomClientMethod "$/progress") (T.pack "provides 3.8 code actions")
35-
sendNotification (CustomClientMethod "$/testid") (T.pack "provides 3.8 code actions")
42+
mark "provides 3.8 code actions"
3643

3744
doc <- openDoc "Format.hs" "haskell"
3845
_diags@(diag1:_) <- waitForDiagnostics
@@ -54,9 +61,9 @@ spec = do
5461

5562
liftIO $ [ca ^. L.title] `shouldContain` ["Add TODO Item 1"]
5663

57-
liftIO $ putStrLn $ "A" -- AZ
64+
mark "A" -- AZ
5865
executeCodeAction ca
59-
liftIO $ putStrLn $ "B" -- AZ
66+
mark "B" -- AZ
6067

6168
-- _ <- skipMany (message @RegisterCapabilityRequest)
6269
-- liftIO $ putStrLn $ "B2" -- AZ
@@ -65,7 +72,7 @@ spec = do
6572
-- liftIO $ putStrLn $ "diags2 = " ++ show _diags2 -- AZ
6673

6774
-- contents <- getDocumentEdit doc
68-
liftIO $ putStrLn $ "C" -- AZ
75+
mark "C" -- AZ
6976
-- liftIO $ contents `shouldBe` "main = undefined\nfoo x = x\n"
7077

7178
-- noDiagnostics

0 commit comments

Comments
 (0)