From 742516b2025cc6e00b602ac1e4340b34cbe7eab2 Mon Sep 17 00:00:00 2001 From: Denis Buzdalov Date: Tue, 26 Sep 2023 17:55:02 +0300 Subject: [PATCH] [ ux ] Add the last newline to the printing of the model coverage --- src/Test/DepTyCheck/Gen/Coverage.idr | 2 +- tests/lib/coverage/ty-and-con-derived-001/expected | 1 + tests/lib/coverage/ty-and-con-derived-002/expected | 1 + tests/lib/coverage/ty-and-con-derived-003/expected | 1 + tests/lib/coverage/ty-and-con-withCov-001/expected | 1 + tests/lib/coverage/ty-and-con-withCov-002/expected | 1 + tests/lib/coverage/ty-and-con-withCov-003/expected | 1 + tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr | 2 +- tests/lib/coverage/ty-and-con-withCov-004/expected | 1 + tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr | 2 +- tests/lib/coverage/ty-and-con-withCov-005/expected | 1 + tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr | 2 +- tests/lib/coverage/ty-and-con-withCov-006/expected | 1 + tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr | 2 +- tests/lib/coverage/ty-and-con-withCov-007/expected | 1 + tests/lib/coverage/ty-and-con-withCov-008/expected | 1 + tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr | 4 ++-- tests/lib/coverage/ty-and-con-withCov-009/expected | 1 + 18 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Test/DepTyCheck/Gen/Coverage.idr b/src/Test/DepTyCheck/Gen/Coverage.idr index cf0ccd062..5701237fd 100644 --- a/src/Test/DepTyCheck/Gen/Coverage.idr +++ b/src/Test/DepTyCheck/Gen/Coverage.idr @@ -128,7 +128,7 @@ showType False ti = show ti.name showType True ti = joinBy "." $ forget $ uncurry lappend $ map (singleton . show . bolden) $ unsnoc $ split (== '.') $ show ti.name toString : (colourful : Bool) -> CoverageGenInfo g -> String -toString col cgi = joinBy "\n\n" $ mapMaybe (\ti => lookup ti cgi.coverageInfo <&> (ti,)) (SortedMap.values cgi.types) <&> \(ti, tyCov, cons) => do +toString col cgi = (++ "\n") $ joinBy "\n\n" $ mapMaybe (\ti => lookup ti cgi.coverageInfo <&> (ti,)) (SortedMap.values cgi.types) <&> \(ti, tyCov, cons) => do let conCovs = values cons let anyCons = not $ null conCovs let allConsCovered = all (== True) conCovs diff --git a/tests/lib/coverage/ty-and-con-derived-001/expected b/tests/lib/coverage/ty-and-con-derived-001/expected index 188148d74..e894bb7ea 100644 --- a/tests/lib/coverage/ty-and-con-derived-001/expected +++ b/tests/lib/coverage/ty-and-con-derived-001/expected @@ -13,3 +13,4 @@ PrintCoverage.Y covered fully - Y1: covered - Y2: covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-derived-002/expected b/tests/lib/coverage/ty-and-con-derived-002/expected index 188148d74..e894bb7ea 100644 --- a/tests/lib/coverage/ty-and-con-derived-002/expected +++ b/tests/lib/coverage/ty-and-con-derived-002/expected @@ -13,3 +13,4 @@ PrintCoverage.Y covered fully - Y1: covered - Y2: covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-derived-003/expected b/tests/lib/coverage/ty-and-con-derived-003/expected index a25f3753e..6d846fbc6 100644 --- a/tests/lib/coverage/ty-and-con-derived-003/expected +++ b/tests/lib/coverage/ty-and-con-derived-003/expected @@ -13,3 +13,4 @@ PrintCoverage.X covered partially PrintCoverage.Y covered partially - YF: covered - YT: not covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-001/expected b/tests/lib/coverage/ty-and-con-withCov-001/expected index 1af4947a3..0be080a21 100644 --- a/tests/lib/coverage/ty-and-con-withCov-001/expected +++ b/tests/lib/coverage/ty-and-con-withCov-001/expected @@ -13,3 +13,4 @@ PrintCoverage.Y covered partially - Y1: covered - Y2: not covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-002/expected b/tests/lib/coverage/ty-and-con-withCov-002/expected index a8a07eb62..4c4c44bbf 100644 --- a/tests/lib/coverage/ty-and-con-withCov-002/expected +++ b/tests/lib/coverage/ty-and-con-withCov-002/expected @@ -13,3 +13,4 @@ PrintCoverage.Y covered partially - Y1: covered - Y2: not covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-003/expected b/tests/lib/coverage/ty-and-con-withCov-003/expected index a8a07eb62..4c4c44bbf 100644 --- a/tests/lib/coverage/ty-and-con-withCov-003/expected +++ b/tests/lib/coverage/ty-and-con-withCov-003/expected @@ -13,3 +13,4 @@ PrintCoverage.Y covered partially - Y1: covered - Y2: not covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr index cc92289ae..526967d72 100644 --- a/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr +++ b/tests/lib/coverage/ty-and-con-withCov-004/PrintCoverage.idr @@ -46,7 +46,7 @@ main = do let mc = concatMap fst vs let ci = registerCoverage mc ci putStrLn $ show ci - putStrLn "\n--------\n" + putStrLn "--------\n" do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 3 let mc = concatMap fst vs let ci = registerCoverage mc ci diff --git a/tests/lib/coverage/ty-and-con-withCov-004/expected b/tests/lib/coverage/ty-and-con-withCov-004/expected index e7ba804c1..a9a89f7b6 100644 --- a/tests/lib/coverage/ty-and-con-withCov-004/expected +++ b/tests/lib/coverage/ty-and-con-withCov-004/expected @@ -29,3 +29,4 @@ PrintCoverage.Y covered partially - Y1: not covered - Y2: not covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr index a9f02ab39..09edaf185 100644 --- a/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr +++ b/tests/lib/coverage/ty-and-con-withCov-005/PrintCoverage.idr @@ -43,7 +43,7 @@ main = do let mc = concatMap fst vs let ci = registerCoverage mc ci putStrLn $ show ci - putStrLn "\n--------\n" + putStrLn "--------\n" do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 3 let mc = concatMap fst vs let ci = registerCoverage mc ci diff --git a/tests/lib/coverage/ty-and-con-withCov-005/expected b/tests/lib/coverage/ty-and-con-withCov-005/expected index e7ba804c1..a9a89f7b6 100644 --- a/tests/lib/coverage/ty-and-con-withCov-005/expected +++ b/tests/lib/coverage/ty-and-con-withCov-005/expected @@ -29,3 +29,4 @@ PrintCoverage.Y covered partially - Y1: not covered - Y2: not covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr index 43c10da5e..a6beef570 100644 --- a/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr +++ b/tests/lib/coverage/ty-and-con-withCov-006/PrintCoverage.idr @@ -43,7 +43,7 @@ main = do let mc = concatMap fst vs let ci = registerCoverage mc ci putStrLn $ show @{Colourful} ci - putStrLn "\n--------\n" + putStrLn "--------\n" do let vs = unGenTryND 100 someStdGen $ genY (limit 10) 3 let mc = concatMap fst vs let ci = registerCoverage mc ci diff --git a/tests/lib/coverage/ty-and-con-withCov-006/expected b/tests/lib/coverage/ty-and-con-withCov-006/expected index 82adbc9b9..db038d700 100644 --- a/tests/lib/coverage/ty-and-con-withCov-006/expected +++ b/tests/lib/coverage/ty-and-con-withCov-006/expected @@ -29,3 +29,4 @@ PrintCoverage.Y covered partially - Y1: not covered - Y2: not covered - Y3: covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr index af512ef31..a193dee69 100644 --- a/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr +++ b/tests/lib/coverage/ty-and-con-withCov-007/PrintCoverage.idr @@ -33,7 +33,7 @@ main = do let mc = concatMap fst vs let ci = registerCoverage mc ci putStrLn $ show ci - putStrLn "\n--------\n" + putStrLn "--------\n" do let vs = unGenTryND 100 someStdGen $ genY 3 let mc = concatMap fst vs let ci = registerCoverage mc ci diff --git a/tests/lib/coverage/ty-and-con-withCov-007/expected b/tests/lib/coverage/ty-and-con-withCov-007/expected index da958db9f..b7615e8af 100644 --- a/tests/lib/coverage/ty-and-con-withCov-007/expected +++ b/tests/lib/coverage/ty-and-con-withCov-007/expected @@ -29,3 +29,4 @@ PrintCoverage.X covered partially PrintCoverage.Y not covered - MkY: not covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-008/expected b/tests/lib/coverage/ty-and-con-withCov-008/expected index 05f5ed8da..64faa72b8 100644 --- a/tests/lib/coverage/ty-and-con-withCov-008/expected +++ b/tests/lib/coverage/ty-and-con-withCov-008/expected @@ -14,3 +14,4 @@ Prelude.Types.Maybe not covered PrintCoverage.X covered partially - X1: covered - X2: not covered + diff --git a/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr b/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr index 0c499c5e6..058414780 100644 --- a/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr +++ b/tests/lib/coverage/ty-and-con-withCov-009/PrintCoverage.idr @@ -30,12 +30,12 @@ main = do let mc = concatMap fst vs let ci = registerCoverage mc ci putStrLn $ show ci - putStrLn "\n--------\n" + putStrLn "--------\n" do let vs = unGenTryND 100 someStdGen $ genX 1 let mc = concatMap fst vs let ci = registerCoverage mc ci putStrLn $ show ci - putStrLn "\n--------\n" + putStrLn "--------\n" do let vs = unGenTryND 100 someStdGen $ genX 2 let mc = concatMap fst vs let ci = registerCoverage mc ci diff --git a/tests/lib/coverage/ty-and-con-withCov-009/expected b/tests/lib/coverage/ty-and-con-withCov-009/expected index b47f9cc97..89de67960 100644 --- a/tests/lib/coverage/ty-and-con-withCov-009/expected +++ b/tests/lib/coverage/ty-and-con-withCov-009/expected @@ -48,3 +48,4 @@ Prelude.Types.Nat not covered PrintCoverage.X covered partially - X1: not covered - X2: covered +