Skip to content

Commit a91e355

Browse files
committed
Make the test a bit more comprehensive
1 parent 299b0d3 commit a91e355

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tests = testGroup "Rename"
2424
[ goldenWithRename "Data constructor" "DataConstructor" $ \doc ->
2525
rename doc (Position 0 15) "Op"
2626
, goldenWithRename "Data constructor with fields" "DataConstructorWithFields" $ \doc ->
27-
rename doc (Position 0 13) "FooRenamed"
27+
rename doc (Position 1 13) "FooRenamed"
2828
, goldenWithRename "Exported function" "ExportedFunction" $ \doc ->
2929
rename doc (Position 2 1) "quux"
3030
, ignoreForGhcVersions [GHC90, GHC92] recordConstructorIssue $
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1+
{-# LANGUAGE NamedFieldPuns #-}
12
data Foo = FooRenamed { a :: Int, b :: Bool }
3+
4+
foo1 :: Foo
5+
foo1 = FooRenamed { a = 1, b = True }
6+
7+
foo2 :: Foo
8+
foo2 = FooRenamed 1 True
9+
10+
fun1 :: Foo -> Int
11+
fun1 FooRenamed {a} = a
12+
13+
fun2 :: Foo -> Int
14+
fun2 FooRenamed {a = i} = i
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1+
{-# LANGUAGE NamedFieldPuns #-}
12
data Foo = Foo { a :: Int, b :: Bool }
3+
4+
foo1 :: Foo
5+
foo1 = Foo { a = 1, b = True }
6+
7+
foo2 :: Foo
8+
foo2 = Foo 1 True
9+
10+
fun1 :: Foo -> Int
11+
fun1 Foo {a} = a
12+
13+
fun2 :: Foo -> Int
14+
fun2 Foo {a = i} = i

0 commit comments

Comments
 (0)