@@ -60,7 +60,7 @@ From (git://nix)/tests/lang.sh we see that
6060-}
6161
6262groupBy :: Ord k => (v -> k ) -> [v ] -> Map k [v ]
63- groupBy key = Map. fromListWith (++ ) . fmap (key &&& pure )
63+ groupBy key = Map. fromListWith (<> ) . fmap (key &&& pure )
6464
6565-- | New tests, which have never yet passed. Once any of these is passing,
6666-- please remove it from this list. Do not add tests to this list if they have
@@ -101,13 +101,13 @@ genTests = do
101101 [" parse" , " fail" ] -> assertParseFail opts $ the files
102102 [" eval" , " okay" ] -> assertEval opts files
103103 [" eval" , " fail" ] -> assertEvalFail $ the files
104- _ -> error $ " Unexpected: " ++ show kind
104+ _ -> error $ " Unexpected: " <> show kind
105105
106106assertParse :: Options -> FilePath -> Assertion
107107assertParse _opts file = parseNixFileLoc file >>= \ case
108108 Success _expr -> pure () -- pure $! runST $ void $ lint opts expr
109109 Failure err ->
110- assertFailure $ " Failed to parse " ++ file ++ " :\n " ++ show err
110+ assertFailure $ " Failed to parse " <> file <> " :\n " <> show err
111111
112112assertParseFail :: Options -> FilePath -> Assertion
113113assertParseFail opts file = do
@@ -118,40 +118,40 @@ assertParseFail opts file = do
118118 _ <- pure $! runST $ void $ lint opts expr
119119 assertFailure
120120 $ " Unexpected success parsing `"
121- ++ file
122- ++ " :\n Parsed value: "
123- ++ show expr
121+ <> file
122+ <> " :\n Parsed value: "
123+ <> show expr
124124 Failure _ -> pure ()
125125 )
126126 $ \ (_ :: SomeException ) -> pure ()
127127
128128assertLangOk :: Options -> FilePath -> Assertion
129129assertLangOk opts file = do
130- actual <- printNix <$> hnixEvalFile opts (file ++ " .nix" )
131- expected <- Text. readFile $ file ++ " .exp"
132- assertEqual " " expected $ Text. pack (actual ++ " \n " )
130+ actual <- printNix <$> hnixEvalFile opts (file <> " .nix" )
131+ expected <- Text. readFile $ file <> " .exp"
132+ assertEqual " " expected $ Text. pack (actual <> " \n " )
133133
134134assertLangOkXml :: Options -> FilePath -> Assertion
135135assertLangOkXml opts file = do
136136 actual <- stringIgnoreContext . toXML <$> hnixEvalFile
137137 opts
138- (file ++ " .nix" )
139- expected <- Text. readFile $ file ++ " .exp.xml"
138+ (file <> " .nix" )
139+ expected <- Text. readFile $ file <> " .exp.xml"
140140 assertEqual " " expected actual
141141
142142assertEval :: Options -> [FilePath ] -> Assertion
143143assertEval _opts files = do
144144 time <- liftIO getCurrentTime
145145 let opts = defaultOptions time
146146 case delete " .nix" $ sort $ fmap takeExtensions files of
147- [] -> () <$ hnixEvalFile opts (name ++ " .nix" )
147+ [] -> () <$ hnixEvalFile opts (name <> " .nix" )
148148 [" .exp" ] -> assertLangOk opts name
149149 [" .exp.xml" ] -> assertLangOkXml opts name
150150 [" .exp.disabled" ] -> pure ()
151151 [" .exp-disabled" ] -> pure ()
152152 [" .exp" , " .flags" ] -> do
153153 liftIO $ setEnv " NIX_PATH" " lang/dir4:lang/dir5"
154- flags <- Text. readFile (name ++ " .flags" )
154+ flags <- Text. readFile (name <> " .flags" )
155155 let flags' | Text. last flags == ' \n ' = Text. init flags
156156 | otherwise = flags
157157 case
@@ -163,18 +163,18 @@ assertEval _opts files = do
163163 Opts. Failure err ->
164164 errorWithoutStackTrace
165165 $ " Error parsing flags from "
166- ++ name
167- ++ " .flags: "
168- ++ show err
166+ <> name
167+ <> " .flags: "
168+ <> show err
169169 Opts. Success opts' -> assertLangOk opts' name
170170 Opts. CompletionInvoked _ -> error " unused"
171- _ -> assertFailure $ " Unknown test type " ++ show files
171+ _ -> assertFailure $ " Unknown test type " <> show files
172172 where
173173 name =
174- " data/nix/tests/lang/" ++ the (fmap (takeFileName . dropExtensions) files)
174+ " data/nix/tests/lang/" <> the (fmap (takeFileName . dropExtensions) files)
175175
176- fixup (" --arg" : x : y : rest) = " --arg" : (x ++ " =" ++ y) : fixup rest
177- fixup (" --argstr" : x : y : rest) = " --argstr" : (x ++ " =" ++ y) : fixup rest
176+ fixup (" --arg" : x : y : rest) = " --arg" : (x <> " =" <> y) : fixup rest
177+ fixup (" --argstr" : x : y : rest) = " --argstr" : (x <> " =" <> y) : fixup rest
178178 fixup (x : rest) = x : fixup rest
179179 fixup [] = []
180180
@@ -185,6 +185,6 @@ assertEvalFail file = catch ?? (\(_ :: SomeException) -> pure ()) $ do
185185 evalResult
186186 `seq` assertFailure
187187 $ file
188- ++ " should not evaluate.\n The evaluation result was `"
189- ++ evalResult
190- ++ " `."
188+ <> " should not evaluate.\n The evaluation result was `"
189+ <> evalResult
190+ <> " `."
0 commit comments