Skip to content

Commit ad84d45

Browse files
committed
Add a new test case
1 parent 0555e09 commit ad84d45

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ghcide/test/exe/Main.hs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,25 @@ extendImportTests = testGroup "extend import actions"
11701170
, "import ModuleA (A (Constructor))"
11711171
, "b :: A"
11721172
, "b = Constructor"
1173+
])
1174+
, testSession "extend single line import with constructor (with comments)" $ template
1175+
[("ModuleA.hs", T.unlines
1176+
[ "module ModuleA where"
1177+
, "data A = Constructor"
1178+
])]
1179+
("ModuleB.hs", T.unlines
1180+
[ "module ModuleB where"
1181+
, "import ModuleA (A ({-Constructor-}))"
1182+
, "b :: A"
1183+
, "b = Constructor"
1184+
])
1185+
(Range (Position 2 5) (Position 2 5))
1186+
["Add A(Constructor) to the import list of ModuleA"]
1187+
(T.unlines
1188+
[ "module ModuleB where"
1189+
, "import ModuleA (A (Constructor{-Constructor-}))"
1190+
, "b :: A"
1191+
, "b = Constructor"
11731192
])
11741193
, testSession "extend single line import with mixed constructors" $ template
11751194
[("ModuleA.hs", T.unlines

0 commit comments

Comments
 (0)