From 434f0e08d1a5f7c706b3fc312801ef4e4fee75b1 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Mon, 2 May 2022 02:27:03 +0200 Subject: [PATCH] make skip functions make more sense --- tests/TAP.idr | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/TAP.idr b/tests/TAP.idr index 5316ce2..f3a5b7e 100644 --- a/tests/TAP.idr +++ b/tests/TAP.idr @@ -84,13 +84,18 @@ export %inline todo : String -> Test todo label = todoWith label "" -export %inline -skipWith : String -> String -> Test -skipWith label reason = One $ MakeTest label $ pure $ Skip reason +private %inline +makeSkip : String -> String -> Test +makeSkip label reason = One $ MakeTest label $ pure $ Skip reason export %inline -skip : String -> Test -skip label = skipWith label "" +skipWith : Test -> String -> Test +skipWith (One t) reason = makeSkip t.label reason +skipWith (Group l _) reason = makeSkip l reason + +export %inline +skip : Test -> Test +skip test = skipWith test "" export testThrows : Show a => String -> Lazy (Error es a) -> Test