pokes in TAP
This commit is contained in:
parent
fa5beb4e2b
commit
e13cd50175
1 changed files with 7 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
module TAP
|
||||
-- [todo] extract this and Quox.Error to their own packages
|
||||
|
||||
import public Quox.Error
|
||||
|
||||
|
@ -45,7 +46,7 @@ All ToInfo es => ToInfo (OneOf es) where
|
|||
|
||||
export %inline ToInfo () where toInfo () = []
|
||||
|
||||
export Show a => ToInfo (List (String, a)) where toInfo = map (map show)
|
||||
export %inline Show a => ToInfo (List (String, a)) where toInfo = map (map show)
|
||||
|
||||
|
||||
export
|
||||
|
@ -121,15 +122,17 @@ export %inline
|
|||
header : List a -> String
|
||||
header tests = "1..\{show $ length tests}"
|
||||
|
||||
private
|
||||
makePrefix : SnocList String -> String
|
||||
makePrefix [<] = ""
|
||||
makePrefix (xs :< x) = foldr (\a, b => "\{a}/\{b}") x xs
|
||||
|
||||
private %inline
|
||||
withPrefix : SnocList String -> TestBase -> Test
|
||||
withPrefix pfx b = One $ {label := "[\{makePrefix pfx}] \{b.label}"} b
|
||||
|
||||
mutual
|
||||
export
|
||||
export %inline
|
||||
flattenWith : SnocList String -> List Test -> List Test
|
||||
flattenWith pfx = concatMap (flatten1With pfx)
|
||||
|
||||
|
@ -138,11 +141,11 @@ mutual
|
|||
flatten1With pfx (One t) = [withPrefix pfx t]
|
||||
flatten1With pfx (Group x ts) = flattenWith (pfx :< x) ts
|
||||
|
||||
export
|
||||
export %inline
|
||||
flatten : List Test -> List Test
|
||||
flatten = flattenWith [<]
|
||||
|
||||
export
|
||||
export %inline
|
||||
flatten1 : Test -> List Test
|
||||
flatten1 = flatten1With [<]
|
||||
|
||||
|
|
Loading…
Reference in a new issue