Skip to content

Commit 236fd5f

Browse files
committed
[ test ] eagerly print test name
1 parent cc608e4 commit 236fd5f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Test/Golden.agda

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ runTest opts testPath = do
204204
true doesDirectoryExist (mkFilePath testPath)
205205
where false fail directoryNotFound
206206

207+
putStr $ concat (testPath ∷ ": " ∷ [])
207208
time time′ $ callCommand $ unwords
208209
$ "cd" ∷ testPath
209210
"&&""sh ./run" ∷ opts .exeUnderTest
@@ -303,14 +304,14 @@ runTest opts testPath = do
303304
when b $ writeFile (testPath String.++ "/expected") out
304305

305306
printTiming : Bool Time String IO _
306-
printTiming false _ msg = putStrLn $ concat (testPath ∷ ": "msg ∷ [])
307+
printTiming false _ msg = putStrLn msg
307308
printTiming true time msg =
308309
let time = ℕ.show (time .seconds) String.++ "s"
309310
spent = 9 + List.sum (List.map String.length (testPath ∷ time ∷ []))
310311
-- ^ hack: both "success" and "FAILURE" have the same length
311312
-- can't use `String.length msg` because the msg contains escape codes
312313
pad = String.replicate (72 ∸ spent) ' '
313-
in putStrLn (concat (testPath ∷ ": "msg ∷ pad ∷ time ∷ []))
314+
in putStrLn (concat (msg ∷ pad ∷ time ∷ []))
314315

315316
-- A test pool is characterised by
316317
-- + a name

0 commit comments

Comments
 (0)