Skip to content

test: repro for #2662: extend import list miss separator #2664

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

Merged
merged 5 commits into from
Jan 31, 2022

Conversation

guibou
Copy link
Collaborator

@guibou guibou commented Jan 31, 2022

This is a repro for #2662.

I've tested with GHC 8.10.7, 9.0.2 and 9.2.1, using nix:

(Note: I do have to export PATH so it point to the correct ghcide. Is that the intended workflow or I missed something?)

GHC 9.2.1:

The import part is:

- "module ModuleB where\nimport Data.List.NonEmpty (fromList, NonEmpty ((:|)))\nmain = case (fromList []) of _ :| _ -> pure ()\n"
+ "module ModuleB where\nimport Data.List.NonEmpty (fromListNonEmpty ((:|)))\nmain = case (fromList []) of _ :| _ -> pure ()\n"
$ nix-shell -p haskell.compiler.ghc921 -p cabal-install -p zlib    

[nix-shell:~/srcs/haskell-language-server]$ export PATH=/home/guillaume/srcs/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-9.2.1/ghcide-1.6.0.0/x/ghcide/build/ghcide/:$PATH

[nix-shell:~/srcs/haskell-language-server]$ ls /home/guillaume/srcs/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-9.2.1/ghcide-1.6.0.0/x/ghcide/build/ghcide/
autogen  ghcide  ghcide-tmp

[nix-shell:~/srcs/haskell-language-server]$ cabal run --project-file ./cabal-ghc921.project ghcide:ghcide-tests -- -p 'infix constru'
Up to date
ghcide
  code actions
    extend import actions
      with checkAll
        extend single line import with infix constructor: FAIL (1.10s)
          test/exe/Main.hs:1827:
          expected: "module ModuleB where\nimport Data.List.NonEmpty (fromList, NonEmpty ((:|)))\nmain = case (fromList []) of _ :| _ -> pure ()\n"
           but got: "module ModuleB where\nimport Data.List.NonEmpty (fromListNonEmpty ((:|)))\nmain = case (fromList []) of _ :| _ -> pure ()\n"
          Use -p '/infix constru/&&/with checkAll.extend single line import with infix constructor/' to rerun this test only.
      without checkAll
        extend single line import with infix constructor: FAIL (1.11s)
          test/exe/Main.hs:1827:
          expected: "module ModuleB where\nimport Data.List.NonEmpty (fromList, NonEmpty ((:|)))\nmain = case (fromList []) of _ :| _ -> pure ()\n"
           but got: "module ModuleB where\nimport Data.List.NonEmpty (fromListNonEmpty ((:|)))\nmain = case (fromList []) of _ :| _ -> pure ()\n"
          Use -p '/infix constru/&&/without checkAll.extend single line import with infix constructor/' to rerun this test only.

2 out of 2 tests failed (2.22s)

GHC 9.0:

$ nix-shell -p haskell.compiler.ghc902 -p cabal-install -p zlib

[nix-shell:~/srcs/haskell-language-server]$ export PATH=/home/guillaume/srcs/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-9.0.2/ghcide-1.6.0.0/x/ghcide/build/ghcide:$PATH

[nix-shell:~/srcs/haskell-language-server]$ which ghcide
/home/guillaume/srcs/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-9.0.2/ghcide-1.6.0.0/x/ghcide/build/ghcide/ghcide

[nix-shell:~/srcs/haskell-language-server]$ cabal run --project-file ./cabal-ghc90.project ghcide:ghcide-tests -- -p 'infix constru'
Up to date
ghcide
  code actions
    extend import actions
      with checkAll
        extend single line import with infix constructor: OK (1.16s)
      without checkAll
        extend single line import with infix constructor: OK (1.14s)

All 2 tests passed (2.31s)

GHC 8.10.7:

λ narwal haskell-language-server → λ git repro_2662 → nix-shell -p haskell.compiler.ghc8107 -p cabal-install -p zlib

[nix-shell:~/srcs/haskell-language-server]$ export PATH=/home/guillaume/srcs/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.7/ghcide-1.6.0.0/x/ghcide/build/ghcide:$PATH
[nix-shell:~/srcs/haskell-language-server]$ which ghcide
/home/guillaume/srcs/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.7/ghcide-1.6.0.0/x/ghcide/build/ghcide/ghcide

[nix-shell:~/srcs/haskell-language-server]$ cabal run --project-file ghcide:ghcide-tests -- -p 'infix constru'
The given project file 'ghcide:ghcide-tests' does not exist.

[nix-shell:~/srcs/haskell-language-server]$ cabal run ghcide:ghcide-tests -- -p 'infix constru'
Resolving dependencies...
Up to date
ghcide
  code actions
    extend import actions
      with checkAll
        extend single line import with infix constructor: OK (1.06s)
      without checkAll
        extend single line import with infix constructor: OK (1.05s)

All 2 tests passed (2.11s)

@guibou guibou requested a review from pepeiborra as a code owner January 31, 2022 15:02
Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the regression tests, they will make the fix lot easier

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, many thanks, maybe is asking for too much but have you any plans to tackle the error itself? 🙂

@jneira jneira added the merge me Label to trigger pull request merge label Jan 31, 2022
@mergify mergify bot merged commit 9cd1fdd into haskell:master Jan 31, 2022
@guibou
Copy link
Collaborator Author

guibou commented Jan 31, 2022

perfect, many thanks, maybe is asking for too much but have you any plans to tackle the error itself? slightly_smiling_face

Well, not yet. Actually, I discovered the issue actually working on another issue (fixing the eval plugin). I'll have a look at it tomorrow ;)

@guibou guibou deleted the repro_2662 branch January 31, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants