diff --git a/tests/TAP.idr b/tests/TAP.idr index 95346f9..7a86ed2 100644 --- a/tests/TAP.idr +++ b/tests/TAP.idr @@ -20,13 +20,19 @@ record TestBase where run : IO Result +private +toLines1 : (String, String) -> List String +toLines1 (k, v) = + let vs = lines v in + if length vs == 1 + then ["\{k}: \{v}"] + else "\{k}: |" :: map (indent 2) vs + private toLines : Info -> List String toLines [] = [] -toLines xs = - "---" :: - concatMap (\(k, v) => "\{k}: |" :: map (indent 2) (lines v)) xs - <+> ["..."] +toLines xs = "---" :: concatMap toLines1 xs <+> ["..."] + public export interface ToInfo e where toInfo : e -> Info