Skip to content

Commit

Permalink
Make the test a bit more comprehensive
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrcek committed Feb 21, 2024
1 parent 299b0d3 commit a91e355
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/hls-rename-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tests = testGroup "Rename"
[ goldenWithRename "Data constructor" "DataConstructor" $ \doc ->
rename doc (Position 0 15) "Op"
, goldenWithRename "Data constructor with fields" "DataConstructorWithFields" $ \doc ->
rename doc (Position 0 13) "FooRenamed"
rename doc (Position 1 13) "FooRenamed"
, goldenWithRename "Exported function" "ExportedFunction" $ \doc ->
rename doc (Position 2 1) "quux"
, ignoreForGhcVersions [GHC90, GHC92] recordConstructorIssue $
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{-# LANGUAGE NamedFieldPuns #-}
data Foo = FooRenamed { a :: Int, b :: Bool }

foo1 :: Foo
foo1 = FooRenamed { a = 1, b = True }

foo2 :: Foo
foo2 = FooRenamed 1 True

fun1 :: Foo -> Int
fun1 FooRenamed {a} = a

fun2 :: Foo -> Int
fun2 FooRenamed {a = i} = i
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{-# LANGUAGE NamedFieldPuns #-}
data Foo = Foo { a :: Int, b :: Bool }

foo1 :: Foo
foo1 = Foo { a = 1, b = True }

foo2 :: Foo
foo2 = Foo 1 True

fun1 :: Foo -> Int
fun1 Foo {a} = a

fun2 :: Foo -> Int
fun2 Foo {a = i} = i

0 comments on commit a91e355

Please sign in to comment.