Commit Graph

51 Commits

Author SHA1 Message Date
Junyoung Clare Jang
34eb232f1e
Restore most of the format tests under golden testing 2020-06-09 14:57:50 -04:00
Junyoung Clare Jang
e4f8df88df
Introduce golden testing for stylish-haskell formatter 2020-06-09 14:30:23 -04:00
Junyoung Clare Jang
c61f27acc4
Add test cases for stylish-haskell 2020-06-05 15:01:38 -04:00
Jeff Windsor
0c1708f80f add xml output to runner 2020-05-16 19:36:53 -07:00
Jeff Windsor
092db6ef96 ignore broken tests 2020-05-16 19:19:49 -07:00
Jeff Windsor
2f555230c0 fix tests do not compile after update 2020-05-16 18:01:13 -07:00
Jeff Windsor
b16623e9e6 fix ResponseMessage change 2020-05-16 17:25:10 -07:00
Jeff Windsor
ade13db938 rename Test.HIE.Util to Test.Hls.Util 2020-05-16 16:54:54 -07:00
Jeff Windsor
fc140e5f7a add tasty-rerun 2020-05-10 18:45:50 -07:00
Jeff Windsor
7c3d784497 use hspec-expectations for shoulds 2020-05-10 18:12:42 -07:00
Jeff Windsor
218ac493e5 add warmup, missing runner 2020-05-10 12:49:28 -07:00
Jeff Windsor
d0c0e6150d move and restore full test util module 2020-05-10 12:25:05 -07:00
Jeff Windsor
8cccd93f48 turn on all tests 2020-05-10 11:59:33 -07:00
Jeff Windsor
f9173b06e4 add other tests 2020-05-10 11:57:34 -07:00
Jeff Windsor
f08db9bbc5 add FunctionalLiquid HieBois Highlist tests 2020-05-10 10:32:08 -07:00
Jeff Windsor
ece0d31a71 add FunctionalCodeAction tests 2020-05-09 20:19:30 -07:00
Jeff Windsor
7b6c550bb8 add format tests 2020-05-09 19:12:59 -07:00
Jeff Windsor
29497543a3 add diagnostic tests 2020-05-09 18:51:05 -07:00
Jeff Windsor
c0d7dd1f46 add definition tests 2020-05-09 18:03:10 -07:00
Jeff Windsor
f3c5b87824 Refactor Test Util and remove spec files 2020-05-09 17:52:49 -07:00
Jeff Windsor
7ba6cc9b9c add Deferred Tests (2 out 4 failing) 2020-05-09 16:50:19 -07:00
Jeff Windsor
86017da8f5 add Completion Tests (all are timing out as of now) 2020-05-09 16:09:23 -07:00
Jeff Windsor
7c4f670569 full test data 2020-05-09 14:27:46 -07:00
Jeff Windsor
d1ab2d8657 Commands (de-prefix failing) 2020-05-09 13:57:55 -07:00
Jeff Windsor
4ec1817652 Move to functional folder with first real test 2020-05-09 13:37:37 -07:00
Jeff Windsor
56363ddca6 Incorporate hls-test-utils 2020-05-09 11:53:12 -07:00
Jeff Windsor
a2a2306751 Initial Structure 2020-05-03 19:02:01 -07:00
fendor
3edfaeb87a Fix func-test for ormolu 2020-04-25 17:40:48 +02:00
unknown
910696ab92 Fix testspec for brittany, also fix warnings 2020-04-19 15:46:47 +02:00
unknown
df144ea04f Enable tests for brittany 2020-04-19 00:24:50 +02:00
unknown
11554bb095 Use direct cradles for test-setup 2020-04-19 00:24:50 +02:00
Alan Zimmerman
abcbdaa4d6 Fix failing hls functional test 2020-04-07 20:27:52 +01:00
Alan Zimmerman
cebd00fab0 Get tests to pass 2020-03-16 22:36:02 +00:00
Alan Zimmerman
2ebf7ae370 Add a "mark" function to write to stdout and the test log
For correlating with circleci logs
2020-03-16 20:49:54 +00:00
Alan Zimmerman
fd28518c48 Put test id in the logs 2020-03-16 20:23:05 +00:00
Alan Zimmerman
20746cf61f Print some progress on the tests 2020-03-16 18:37:50 +00:00
Alan Zimmerman
7552c58c93 Mark documentContents failing tests pending
It seems lsp-test is not applying edits properly, doing the same sequence in
vscode results in the correct result.
2020-03-15 11:47:33 +00:00
Alan Zimmerman
fa46f7fc2f Add symbols provider to plugin support 2020-03-15 11:42:17 +00:00
Alan Zimmerman
43d6381723 Investigating the failing formatter tests.
Conclusion is that getDocumentContents is returning junk, doing the idempotent
test manually on vscode works as expected, but ends up with junk at the end of
the file in the test.

2020-03-12 21:11:05.79062259 [ThreadId 38] - Formatter.doFormatting: contents=
"{-# LANGUAGE NoImplicitPrelude #-}
module    Format where
foo   :: Int ->  Int
foo  3 = 2
foo    x  = x
bar   :: String ->   IO String
bar s =  do
      x <- return \"hello\"
      return \"asdf\"
"

2020-03-12 21:11:07.896114974 [ThreadId 7] - <--2--{"result":[{"range":{"start":{"line":0,"character":0},"end":{"line":9,"character":0}},"newText":
"{-# LANGUAGE NoImplicitPrelude #-}

module Format where

foo :: Int -> Int
foo 3 = 2
foo x = x

bar :: String -> IO String
bar s = do
  x <- return \"hello\"
  return \"asdf\"
"}],"jsonrpc":"2.0","id":1}

2020-03-12 21:11:07.897123428 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":0,"uri":"file:///home/alanz/mysrc/github/alanz/haskell-language-server/test/testdata/Format.hs"},"contentChanges":[{"text":
"{-# LANGUAGE NoImplicitPrelude #-}

module Format where

foo :: Int -> Int
foo 3 = 2
foo x = x

bar :: String -> IO String
bar s = do
  x <- return \"hello\"
  return \"asdf\"
","range":{"start":{"line":0,"character":0},"end":{"line":9,"character":0}}}]}}

-------------------------------------------------------

2020-03-12 21:11:07.899375044 [ThreadId 213] - Formatter.doFormatting: contents="{-# LANGUAGE NoImplicitPrelude #-}
module    Format where
foo   :: Int ->  Int
foo  3 = 2
foo    x  = x
bar   :: String ->   IO String
bar s =  do
      x <- return \"hello\"
      return \"asdf\"
"

2020-03-12 21:11:07.902320214 [ThreadId 7] - <--2--{"result":[{"range":{"start":{"line":0,"character":0},"end":{"line":9,"character":0}},"newText":"{-# LANGUAGE NoImplicitPrelude #-}

module Format where

foo :: Int -> Int
foo 3 = 2
foo x = x

bar :: String -> IO String
bar s = do
  x <- return \"hello\"
  return \"asdf\"
"}],"jsonrpc":"2.0","id":2}

2020-03-12 21:11:07.902812215 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":0,"uri":"file:///home/alanz/mysrc/github/alanz/haskell-language-server/test/testdata/Format.hs"},"contentChanges":[{"text":
"{-# LANGUAGE NoImplicitPrelude #-}

module Format where

foo :: Int -> Int
foo 3 = 2
foo x = x

bar :: String -> IO String
bar s = do
  x <- return \"hello\"
  return \"asdf\"
","range":{"start":{"line":0,"character":0},"end":{"line":9,"character":0}}}]}}

--------------------------------

hieCommand: haskell-language-server --lsp -d -l test-logs/hie-stack-8.6.5.yaml.log
HIE cache is warmed up

Format
  formatting provider
    formatting is idempotent FAILED [1]

Failures:

  test/functional/FormatSpec.hs:64:42:
  1) Format, formatting provider, formatting is idempotent
       expected: "{-# LANGUAGE NoImplicitPrelude #-}\n\nmodule Format where\n\nfoo :: Int -> Int\nfoo 3 = 2\nfoo x = x\n\nbar :: String -> IO String\nbar s = do\n  x <- return \"hello\"\n  return \"asdf\"\n"
        but got: "{-# LANGUAGE NoImplicitPrelude #-}\n\nmodule Format where\n\nfoo :: Int -> Int\nfoo 3 = 2\nfoo x = x\n\nbar :: String -> IO String\nbar s = do\n  x <- return \"hello\"\n  return \"asdf\"\nbar s = do\n  x <- return \"hello\"\n  return \"asdf\"\n"

  To rerun use: --match "/Format/formatting provider/formatting is idempotent/"

Randomized with seed 1814425400
2020-03-15 11:42:17 +00:00
Alan Zimmerman
b02bf3323e Working on tests.
Currently suspect the range we get to format the whole file is wrong, second
time around.
2020-03-15 11:41:51 +00:00
Alan Zimmerman
a33c2b481d More plugin refactoring, add codelens support
Starting to look pretty solid.
2020-03-15 11:41:16 +00:00
Alan Zimmerman
bcc4b96692 Add logging
It piggy-backs existing args from ghcide, probably a bad idea
2020-03-15 11:41:05 +00:00
Alan Zimmerman
5c4758e5f2 Break out Code Action providers into their own handler 2020-03-15 11:39:45 +00:00
Alan Zimmerman
3088e6da0a Starting to sketch out IDE-level plugin modularity
Address #25

Currently WIP
2020-03-15 11:39:45 +00:00
Alan Zimmerman
e726dfe894 Tweak tests for a pass
The floskell formatting is not correct, but this is initially about getting the
plugin machinery into place.
2020-02-17 19:35:33 +00:00
Alan Zimmerman
a30949bd57 Bringing in ability to select provider.
Needs https://github.com/digital-asset/ghcide/pull/412 to land first, as a basis
for the needed changes
2020-02-12 22:41:43 +00:00
Alan Zimmerman
5e9684b7db Clean up a bit based on @fendor review 2020-02-07 18:18:33 +00:00
Alan Zimmerman
769797c49b Format tests pass for Ormolu 2020-02-06 21:49:11 +00:00
Alan Zimmerman
2521a7f965 WIP on formatting spec, via hspec
We only have an Ormolu formatter at present, want to make sure the circle stuff
actually works too.

Need to plumb the config values through to the actual formatter.
2020-02-06 21:17:50 +00:00
Alan Zimmerman
22ec25670a WIP on introducing tasty test suite 2020-02-06 18:12:12 +00:00