projects
/
opengl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use stack for testing for now
[opengl.git]
/
test
/
Test.hs
diff --git
a/test/Test.hs
b/test/Test.hs
index 08c21be300e45fc9b87e766750399fc8b62d5329..d524ee4ffe15c666c8feaabdd5c518e804782a58 100644
(file)
--- a/
test/Test.hs
+++ b/
test/Test.hs
@@
-18,7
+18,6
@@
import GHC.Generics
import Language.Haskell.LSP.Messages
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.Test.Replay
import Language.Haskell.LSP.Messages
import Language.Haskell.LSP.Test
import Language.Haskell.LSP.Test.Replay
-import Language.Haskell.LSP.Types.Capabilities
import Language.Haskell.LSP.Types as LSP hiding (capabilities, message)
import System.Timeout
import Language.Haskell.LSP.Types as LSP hiding (capabilities, message)
import System.Timeout
@@
-113,7
+112,7
@@
main = hspec $ do
selector _ = False
sesh = do
doc <- openDoc "Desktop/simple.hs" "haskell"
selector _ = False
sesh = do
doc <- openDoc "Desktop/simple.hs" "haskell"
- sendRequest
'
TextDocumentDocumentSymbol (DocumentSymbolParams doc)
+ sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc)
skipMany anyNotification
message :: Session RenameResponse -- the wrong type
in runSession "hie --lsp" fullCaps "test/data/renamePass" sesh
skipMany anyNotification
message :: Session RenameResponse -- the wrong type
in runSession "hie --lsp" fullCaps "test/data/renamePass" sesh
@@
-134,7
+133,7
@@
main = hspec $ do
noDiagnostics
noDiagnostics
- (fooSymbol:_) <- getDocumentSymbols doc
+
Right
(fooSymbol:_) <- getDocumentSymbols doc
liftIO $ do
fooSymbol ^. name `shouldBe` "foo"
liftIO $ do
fooSymbol ^. name `shouldBe` "foo"
@@
-149,7
+148,7
@@
main = hspec $ do
(Position 1 14)
"Redundant bracket"
reqParams = ExecuteCommandParams "applyrefact:applyOne" (Just (List [args]))
(Position 1 14)
"Redundant bracket"
reqParams = ExecuteCommandParams "applyrefact:applyOne" (Just (List [args]))
-
sendR
equest_ WorkspaceExecuteCommand reqParams
+
r
equest_ WorkspaceExecuteCommand reqParams
editReq <- message :: Session ApplyWorkspaceEditRequest
liftIO $ do
editReq <- message :: Session ApplyWorkspaceEditRequest
liftIO $ do
@@
-172,7
+171,7
@@
main = hspec $ do
(Position 1 14)
"Redundant bracket"
reqParams = ExecuteCommandParams "applyrefact:applyOne" (Just (List [args]))
(Position 1 14)
"Redundant bracket"
reqParams = ExecuteCommandParams "applyrefact:applyOne" (Just (List [args]))
-
sendR
equest_ WorkspaceExecuteCommand reqParams
+
r
equest_ WorkspaceExecuteCommand reqParams
contents <- getDocumentEdit doc
liftIO $ contents `shouldBe` "main :: IO Int\nmain = return 42\n"
noDiagnostics
contents <- getDocumentEdit doc
liftIO $ contents `shouldBe` "main :: IO Int\nmain = return 42\n"
noDiagnostics
@@
-183,7
+182,7
@@
main = hspec $ do
_ <- waitForDiagnostics
actions <- getAllCodeActions doc
liftIO $ do
_ <- waitForDiagnostics
actions <- getAllCodeActions doc
liftIO $ do
- let [C
ommandOrCodeAction
CodeAction action] = actions
+ let [C
A
CodeAction action] = actions
action ^. title `shouldBe` "Apply hint:Redundant bracket"
action ^. command . _Just . command `shouldSatisfy` T.isSuffixOf ":applyrefact:applyOne"
action ^. title `shouldBe` "Apply hint:Redundant bracket"
action ^. command . _Just . command `shouldSatisfy` T.isSuffixOf ":applyrefact:applyOne"
@@
-195,13
+194,12
@@
main = hspec $ do
noDiagnostics
noDiagnostics
- (mainSymbol:_) <- getDocumentSymbols doc
+
Left
(mainSymbol:_) <- getDocumentSymbols doc
liftIO $ do
mainSymbol ^. name `shouldBe` "main"
mainSymbol ^. kind `shouldBe` SkFunction
liftIO $ do
mainSymbol ^. name `shouldBe` "main"
mainSymbol ^. kind `shouldBe` SkFunction
- mainSymbol ^. location . range `shouldBe` Range (Position 3 0) (Position 3 4)
- mainSymbol ^. containerName `shouldBe` Nothing
+ mainSymbol ^. range `shouldBe` Range (Position 3 0) (Position 3 4)
describe "applyEdit" $ do
it "increments the version" $ runSession "hie --lsp" docChangesCaps "test/data/renamePass" $ do
describe "applyEdit" $ do
it "increments the version" $ runSession "hie --lsp" docChangesCaps "test/data/renamePass" $ do