File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import Nix.Pretty
2020import Nix.String
2121import Nix.XML
2222import qualified Options.Applicative as Opts
23- import System.Environment
23+ import System.Environment ( setEnv )
2424import System.FilePath.Glob ( compile
2525 , globDir1
2626 )
Original file line number Diff line number Diff line change @@ -221,8 +221,7 @@ normalize = foldFix $ \case
221221
222222-- | Test that parse . pretty == id up to attribute position information.
223223prop_prettyparse :: Monad m => NExpr -> PropertyT m ()
224- prop_prettyparse p = do
225- let prog = show $ prettyNix p
224+ prop_prettyparse p =
226225 either
227226 (\ s -> do
228227 footnote $ show $ vsep
@@ -263,6 +262,8 @@ prop_prettyparse p = do
263262 )
264263 (parse $ fromString prog)
265264 where
265+ prog = show $ prettyNix p
266+
266267 parse = parseNixText
267268
268269 normalise s = String. unlines $ reverse . dropWhile isSpace . reverse <$> String. lines s
@@ -271,6 +272,6 @@ prop_prettyparse p = do
271272 ldiff s1 s2 = getDiff ((: mempty ) <$> String. lines s1) ((: mempty ) <$> String. lines s2)
272273
273274tests :: TestLimit -> TestTree
274- tests n = testProperty " Pretty/Parse Property " $ withTests n $ property $ do
275- x <- forAll genExpr
276- prop_prettyparse x
275+ tests n =
276+ testProperty " Pretty/Parse Property " $
277+ withTests n $ property $ prop_prettyparse =<< forAll genExpr
You can’t perform that action at this time.
0 commit comments