diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-05-12 22:47:24 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-05-12 22:47:24 +0200 |
commit | 4540b22202cc62337b8781ba38a9cbe007753f33 (patch) | |
tree | df0b1d38066572256385b08ad41c0ea8a5230b80 /test | |
parent | 5e8656f3e3f169c62defc2d8573c66a679c4757e (diff) |
show diff in auto reject mode too
Diffstat (limited to 'test')
-rw-r--r-- | test/runTests.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/runTests.hs b/test/runTests.hs index 23891b77..14d8f5ca 100644 --- a/test/runTests.hs +++ b/test/runTests.hs | |||
@@ -272,15 +272,15 @@ doTest Config{..} (i, fn) = do | |||
272 | let d = diff e' $ lines e | 272 | let d = diff e' $ lines e |
273 | case d of | 273 | case d of |
274 | _ | all (\case Both{} -> True; _ -> False) d -> return ("OK", Passed) | 274 | _ | all (\case Both{} -> True; _ -> False) d -> return ("OK", Passed) |
275 | rs | cfgReject-> return ("!Different .out file", Rejected) | 275 | rs -> do |
276 | | otherwise -> do | ||
277 | mapM_ putStrLn $ printOldNew msg d | 276 | mapM_ putStrLn $ printOldNew msg d |
278 | putStrLn $ ef ++ " has changed." | 277 | putStrLn $ ef ++ " has changed." |
279 | putStr $ "Accept new " ++ msg ++ " (y/n)? " | 278 | if cfgReject then return ("!Different .out file", Rejected) else do |
280 | c <- getYNChar | 279 | putStr $ "Accept new " ++ msg ++ " (y/n)? " |
281 | if c | 280 | c <- getYNChar |
282 | then writeFile ef e >> return ("Accepted .out file", Accepted) | 281 | if c |
283 | else return ("!Rejected .out file", Rejected) | 282 | then writeFile ef e >> return ("Accepted .out file", Accepted) |
283 | else return ("!Rejected .out file", Rejected) | ||
284 | 284 | ||
285 | printOldNew :: String -> [Item String] -> [String] | 285 | printOldNew :: String -> [Item String] -> [String] |
286 | printOldNew msg d = (msg ++ " has changed.") : ff [] 0 d | 286 | printOldNew msg d = (msg ++ " has changed.") : ff [] 0 d |