Skip to content

hls-eval-plugin tests nearly all fail when trying to build with nixpkgs #1809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maralorn opened this issue May 7, 2021 · 4 comments
Open
Labels
component: hls-eval-plugin old_type: distribution type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@maralorn
Copy link
Contributor

maralorn commented May 7, 2021

Your environment

Building hls-eval-plugin-1.1.0.0 inside nixpkgs.

Which OS do you use:
Nixos

Steps to reproduce

Run tests

Actual behaviour

The log is to long to paste out of my terminal.
I just paste the last few lines as examples.

IO expressions are supported, stdout/stderr output is ignored:                                      OK (1.72s)
  Property checking:                                                                                  FAIL (1.95s)    test/Main.hs:188:
    expected: "-- Support for property checking\r\nmodule TProperty where\r\n\r\n-- prop> \\(l::[Bool]) -> reverse (reverse l) == l\r\n-- +++ OK, passed 100 tests.\r\n\r\n"
     but got: "-- Support for property checking\r\nmodule TProperty where\r\n\r\n-- prop> \\(l::[Bool]) -> reverse (reverse l) == l\r\n\r\n"
  Prelude has no special treatment, it is imported as stated in the module:                           FAIL (1.35s)
    test/Main.hs:188:
    expected: "-- Prelude has no special treatment, it is imported as stated in the module.\r\nmodule TPrelude where\r\n\r\nimport           Prelude hiding (foldr)\r\n\r\n-- >>> foldr (+) 10 [2,3,5]\r\n-- 20\r\nfoldr :: (a -> z -> z) -> z -> [a] -> z\r\nfoldr f z bs =\r\n   (foldl (\\g a -> g . f a) id bs) z\r\n\r\n"
     but got: "-- Prelude has no special treatment, it is imported as stated in the module.\r\nmodule TPrelude where\r\n\r\nimport           Prelude hiding (foldr)\r\n\r\n-- >>> foldr (+) 10 [2,3,5]\r\nfoldr :: (a -> z -> z) -> z -> [a] -> z\r\nfoldr f z bs =\r\n   (foldl (\\g a -> g . f a) id bs) z\r\n\r\n"
  Don't panic on {-# UNPACK #-} pragma:                                                               FAIL (1.68s)
    test/Main.hs:188:
    expected: "{- | Won't panic on UNPACKs -}\r\nmodule TUNPACK (THStatus(..)) where\r\n\r\ntype ByteString = String\r\ntype BSEndo = ByteString -> ByteString\r\ntype BSEndoList = [ByteString] -> [ByteString]\r\n\r\ndata THStatus = THStatus\r\n    {-# UNPACK #-} !Int -- running total byte count\r\n    BSEndoList -- pre
viously parsed lines\r\n    BSEndo -- bytestrings to be prepended\r\n\r\n-- >>> \"Yay! UNPACK pragma didn't do bad things!\"\r\n-- \"Yay! UNPACK pragma didn't do bad things!\"\r\n"
     but got: "{- | Won't panic on UNPACKs -}\r\nmodule TUNPACK (THStatus(..)) where\r\n\r\ntype ByteString = String\r\ntype BSEndo = ByteString -> ByteString\r\ntype BSEndoList = [ByteString] -> [ByteString]\r\n\r\ndata THStatus = THStatus\r\n    {-# UNPACK #-} !Int -- running total byte count\r\n    BSEndoList -- pre
viously parsed lines\r\n    BSEndo -- bytestrings to be prepended\r\n\r\n-- >>> \"Yay! UNPACK pragma didn't do bad things!\"\r\n"
  Can handle eval inside nested comment properly:                                                     FAIL (2.02s)
    test/Main.hs:188:
    expected: "module TNseted () where\r\n{-\r\n>>> 54\r\n54\r\n{-\r\nNested\r\n-}\r\n-}\r\n\r\n{-\r\n{-\r\n>>> 42\r\n42\r\n-}\r\n-}\r\n"
     but got: "module TNseted () where\r\n{-\r\n>>> 54\r\n{-\r\nNested\r\n-}\r\n-}\r\n\r\n{-\r\n{-\r\n>>> 42\r\n-}\r\n-}\r\n"  Test on last line insert results correctly:                                                         FAIL (2.15s)
    test/Main.hs:188:
    expected: "module TLastLine where\r\n\r\n-- >>> take 3 [1..]\r\n-- [1,2,3]\r\n"
     but got: "module TLastLine where\n\n-- >>> take 3 [1..]"
  with preprocessors    CPP support:                                                                                      FAIL (1.57s)
      test/Main.hs:188:
      expected: "{-# LANGUAGE CPP #-}\r\n{-# LANGUAGE OverloadedStrings #-}\r\n{-# LANGUAGE RecordWildCards #-}\r\n\r\nmodule TCPP where\r\n\r\n-- >>> y\r\n-- 11\r\ny :: Integer\r\ny = 11\r\n\r\n#define ALL\r\n\r\n#ifdef ALL\r\n-- >>> 3+y\r\n-- 14\r\n#else\r\n-- >>> 5+y\r\n#endif\r\n\r\n-- >>> 2+y\r\n-- 13\r\n"
       but got: "{-# LANGUAGE CPP #-}\r\n{-# LANGUAGE OverloadedStrings #-}\r\n{-# LANGUAGE RecordWildCards #-}\r\n\r\nmodule TCPP where\r\n\r\n-- >>> y\r\ny :: Integer\r\ny = 11\r\n\r\n#define ALL\r\n\r\n#ifdef ALL\r\n-- >>> 3+y\r\n#else\r\n-- >>> 5+y\r\n#endif\r\n\r\n-- >>> 2+y\r\n"
    Literate Haskell Bird Style:                                                                      FAIL (1.44s)
      test/Main.hs:188:
      expected: "An example LHS\r\n\r\n> {-# LANGUAGE OverloadedStrings #-}\r\n\r\n> module TLHS where\r\n\r\nMore comments, here.\r\n\r\n> -- | >>> 2+2\r\n> -- 4\r\n\r\n> -- | >>> x+a\r\n> -- 14\r\n\r\n> {- |\r\n> >>> 5+5\r\n> WAS 11\r\n> NOW 10\r\n> -}\r\n> x :: Integer\r\n> x = 3\r\n\r\n> a :: Integer\r\n> a = 11\r\
n\r\n"
       but got: "An example LHS\r\n\r\n> {-# LANGUAGE OverloadedStrings #-}\r\n\r\n> module TLHS where\r\n\r\nMore comments, here.\r\n\r\n> -- | >>> 2+2\r\n\r\n> -- | >>> x+a\r\n\r\n> {- |\r\n> >>> 5+5\r\n> 11\r\n> -}\r\n> x :: Integer\r\n> x = 3\r\n\r\n> a :: Integer\r\n> a = 11\r\n\r\n"
  Works with NoImplicitPrelude:                                                                       FAIL (2.06s)
    test/Main.hs:188:
    expected: "{-# LANGUAGE NoImplicitPrelude #-}\r\n\r\nmodule TNoImplicitPrelude where\r\n\r\nimport Data.List (unwords)\r\nimport Data.String (String)\r\n\r\n-- >>> unwords example\r\n-- \"This is an example of evaluation\"\r\nexample :: [String]\r\nexample = [\"This\",\"is\",\"an\",\"example\",\"of\",\"evaluation\"
]\r\n"
     but got: "{-# LANGUAGE NoImplicitPrelude #-}\r\n\r\nmodule TNoImplicitPrelude where\r\n\r\nimport Data.List (unwords)\r\nimport Data.String (String)\r\n\r\n-- >>> unwords example\r\nexample :: [String]\r\nexample = [\"This\",\"is\",\"an\",\"example\",\"of\",\"evaluation\"]\r\n"
  Variable 'it' works:                                                                                FAIL (1.84s)
    test/Main.hs:188:
    expected: "module TIt where\r\n\r\n-- >>> \"test\"\r\n-- >>> it\r\n-- \"test\"\r\n-- \"test\"\r\n\r\n-- >>> pure \"test2\"\r\n-- >>> it\r\n-- \"test2\"\r\n-- \"test2\"\r\n"
     but got: "module TIt where\r\n\r\n-- >>> \"test\"\r\n-- >>> it\r\n\r\n-- >>> pure \"test2\"\r\n-- >>> it\r\n"

47 out of 50 tests failed (2.15s)
Test suite tests: FAIL
Test suite logged to: dist/test/hls-eval-plugin-1.1.0.0-tests.log
0 of 1 test suites (0 of 1 test cases) passed.

Some of the issues look like the same whitespace issues as in #1808. But besides that the eval plugin does simply not appear to work. I am curious to see if it works with the finished hls that I am currently building.

@jneira jneira added os: nixos type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. type: testing component: hls-eval-plugin labels May 8, 2021
@felixonmars
Copy link
Contributor

I am getting the same test failures when building for Arch.

Full logs: https://gist.github.com/felixonmars/e5175d014a63f7740fc2730be36d469a

@felixonmars
Copy link
Contributor

BTW, I can confirm that despite all these test failures, hls-eval-plugin actually works in my Visual Studio Code with packaged haskell-language-server from Arch's official repos:

Peek 2021-05-11 07-41

@maralorn
Copy link
Contributor Author

Same for me eval plugin works great in nixpkgs! And it’s really snappy, too.

@felixonmars
Copy link
Contributor

More errors are present in 1.1.1.0 release: https://paste.xinu.at/TLq/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-eval-plugin old_type: distribution type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

5 participants