Skip to content

Commit 951ce92

Browse files
committed
fix rename plugin concurrent test suite
The tests run all in parallel on the same workspace, and most of the modules have the same module name Main. Result: parallel writes to the same .hie files in the local tmp folder that lead to IO errors in Windows
1 parent 1ce6cc9 commit 951ce92

29 files changed

+40
-12
lines changed

plugins/hls-rename-plugin/test/Main.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ renamePlugin = Rename.descriptor "rename"
1515
tests :: TestTree
1616
tests = testGroup "Rename"
1717
[ goldenWithRename "Data constructor" "DataConstructor" $ \doc -> do
18-
rename doc (Position 0 15) "Op"
18+
rename doc (Position 1 15) "Op"
1919
, goldenWithRename "Exported function" "ExportedFunction" $ \doc -> do
2020
rename doc (Position 2 1) "quux"
2121
, goldenWithRename "Function argument" "FunctionArgument" $ \doc -> do
2222
rename doc (Position 3 4) "y"
2323
, goldenWithRename "Function name" "FunctionName" $ \doc -> do
24-
rename doc (Position 3 1) "baz"
24+
rename doc (Position 4 1) "baz"
2525
, goldenWithRename "GADT" "Gadt" $ \doc -> do
2626
rename doc (Position 6 37) "Expr"
2727
, goldenWithRename "Hidden function" "HiddenFunction" $ \doc -> do
28-
rename doc (Position 0 32) "quux"
28+
rename doc (Position 1 32) "quux"
2929
, goldenWithRename "Imported function" "ImportedFunction" $ \doc -> do
30-
rename doc (Position 3 8) "baz"
30+
rename doc (Position 4 8) "baz"
3131
, goldenWithRename "Import hiding" "ImportHiding" $ \doc -> do
32-
rename doc (Position 0 22) "hiddenFoo"
32+
rename doc (Position 1 22) "hiddenFoo"
3333
, goldenWithRename "Let expression" "LetExpression" $ \doc -> do
3434
rename doc (Position 5 11) "foobar"
3535
, goldenWithRename "Qualified as" "QualifiedAs" $ \doc -> do
36-
rename doc (Position 3 10) "baz"
36+
rename doc (Position 4 10) "baz"
3737
, goldenWithRename "Qualified shadowing" "QualifiedShadowing" $ \doc -> do
38-
rename doc (Position 3 12) "foobar"
38+
rename doc (Position 4 12) "foobar"
3939
, goldenWithRename "Qualified function" "QualifiedFunction" $ \doc -> do
40-
rename doc (Position 3 12) "baz"
40+
rename doc (Position 4 12) "baz"
4141
, goldenWithRename "Realigns do block indentation" "RealignDo" $ \doc -> do
42-
rename doc (Position 0 2) "fooBarQuux"
42+
rename doc (Position 1 2) "fooBarQuux"
4343
, goldenWithRename "Record field" "RecordField" $ \doc -> do
44-
rename doc (Position 6 9) "number"
44+
rename doc (Position 7 9) "number"
4545
, goldenWithRename "Shadowed name" "ShadowedName" $ \doc -> do
4646
rename doc (Position 1 1) "baz"
4747
, goldenWithRename "Typeclass" "Typeclass" $ \doc -> do
4848
rename doc (Position 8 15) "Equal"
4949
, goldenWithRename "Type constructor" "TypeConstructor" $ \doc -> do
50-
rename doc (Position 2 17) "BinaryTree"
50+
rename doc (Position 3 17) "BinaryTree"
5151
, goldenWithRename "Type variable" "TypeVariable" $ \doc -> do
52-
rename doc (Position 0 13) "b"
52+
rename doc (Position 1 13) "b"
5353
]
5454

5555
goldenWithRename :: TestName -> FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree

plugins/hls-rename-plugin/test/testdata/DataConstructor.expected.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module DataConstructor where
12
data Expr = Op Int Int
23

34
plus :: Expr -> Expr

plugins/hls-rename-plugin/test/testdata/DataConstructor.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module DataConstructor where
12
data Expr = Apply Int Int
23

34
plus :: Expr -> Expr

plugins/hls-rename-plugin/test/testdata/FunctionName.expected.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module FunctionName where
12
main = do
23
x <- return $ baz 42
34
return (baz x)

plugins/hls-rename-plugin/test/testdata/FunctionName.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module FunctionName where
12
main = do
23
x <- return $ foo 42
34
return (foo x)

plugins/hls-rename-plugin/test/testdata/Gadt.expected.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE GADTs #-}
2+
module Gadt where
23

34
data Expr a where
45
Number :: Int -> Expr Int

plugins/hls-rename-plugin/test/testdata/Gadt.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE GADTs #-}
2+
module Gadt where
23

34
data Expression a where
45
Number :: Int -> Expression Int

plugins/hls-rename-plugin/test/testdata/HiddenFunction.expected.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module HiddenFunction where
12
import Foo hiding (quux)
23

34
foo :: Int -> Int

plugins/hls-rename-plugin/test/testdata/HiddenFunction.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module HiddenFunction where
12
import Foo hiding (foo)
23

34
foo :: Int -> Int

plugins/hls-rename-plugin/test/testdata/ImportHiding.expected.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
module ImportHiding where
12
import Foo hiding (hiddenFoo)
23

34
foo :: Int -> Int

0 commit comments

Comments
 (0)