Skip to content

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

Open
@maralorn

Description

@maralorn

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions