mrcjkb / neotest-haskell

Neotest adapter for Haskell (cabal or stack) with support for Sydtest, Hspec and Tasty
GNU General Public License v2.0
55 stars 4 forks source link

Virtual text misplaced if there are 2 `it` tests with the same description #140

Open mrcjkb opened 11 months ago

mrcjkb commented 11 months ago

Neovim version (nvim -v)

v0.10.0

Operating system/version

NixOS unstable

How to reproduce the issue

Given the following hspec test:

describe "Namespace0" $ 
  describe "Namespace1" $
    it "foo" $ True `shouldBe` True -- succeeds
  describe "Namespace2" $
    it "foo" $ True `shouldBe` False -- fails

When I run the tests for the file

Expected behaviour

Then the failure message is added as virtual text as follows:

describe "Namespace0" $ 
  describe "Namespace1" $
    it "foo" $ True `shouldBe` True
  describe "Namespace2" $
    it "foo" $ True `shouldBe` False -- error: expected True but got False

Actual behaviour

Then the failure message is added as virtual text as follows:

describe "Namespace0" $ 
  describe "Namespace1" $
    it "foo" $ True `shouldBe` True -- error: expected True but got False
  describe "Namespace2" $
    it "foo" $ True `shouldBe` False -- error: expected True but got False

A minimal Neovim config used to reproduce this issue.

N/A