|
4 | 4 | module THTests (tests) where
|
5 | 5 |
|
6 | 6 | import Control.Monad.IO.Class (liftIO)
|
7 |
| -import Data.List.Extra (dropEnd, dropEnd1) |
8 | 7 | import Data.Row
|
9 | 8 | import qualified Data.Text as T
|
10 | 9 | import Development.IDE.GHC.Util
|
@@ -142,7 +141,7 @@ thReloadingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
|
142 | 141 | expectDiagnostics [("THB.hs", [(DiagnosticSeverity_Warning, (4,1), "Top-level binding")])]
|
143 | 142 |
|
144 | 143 | -- Change th from () to Bool
|
145 |
| - let aSource' = T.unlines $ dropEnd1 (T.lines aSource) ++ ["th_a = [d| a = False|]"] |
| 144 | + let aSource' = T.unlines $ init (T.lines aSource) ++ ["th_a = [d| a = False|]"] |
146 | 145 | changeDoc adoc [TextDocumentContentChangeEvent . InR . (.==) #text $ aSource']
|
147 | 146 | -- generate an artificial warning to avoid timing out if the TH change does not propagate
|
148 | 147 | changeDoc cdoc [TextDocumentContentChangeEvent . InR . (.==) #text $ cSource <> "\nfoo=()"]
|
@@ -176,11 +175,11 @@ thLinkingTest unboxed = testCase name $ runWithExtraFiles dir $ \dir -> do
|
176 | 175 |
|
177 | 176 | expectDiagnostics [("THB.hs", [(DiagnosticSeverity_Warning, (4,1), "Top-level binding")])]
|
178 | 177 |
|
179 |
| - let aSource' = T.unlines $ dropEnd 2 (T.lines aSource) ++ ["th :: DecsQ", "th = [d| a = False|]"] |
| 178 | + let aSource' = T.unlines $ init (init (T.lines aSource)) ++ ["th :: DecsQ", "th = [d| a = False|]"] |
180 | 179 | changeDoc adoc [TextDocumentContentChangeEvent . InR . (.==) #text $ aSource']
|
181 | 180 |
|
182 | 181 | -- modify b too
|
183 |
| - let bSource' = T.unlines $ dropEnd1 (T.lines bSource) ++ ["$th"] |
| 182 | + let bSource' = T.unlines $ init (T.lines bSource) ++ ["$th"] |
184 | 183 | changeDoc bdoc [TextDocumentContentChangeEvent . InR . (.==) #text $ bSource']
|
185 | 184 | waitForProgressBegin
|
186 | 185 | waitForAllProgressDone
|
|
0 commit comments