From e37f7385733a442178b5ce0b8f00284e27bef65e Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 22 Aug 2022 22:04:01 +0300 Subject: [PATCH] /lib/test: add +expect-success helper --- pkg/base-dev/lib/test.hoon | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/base-dev/lib/test.hoon b/pkg/base-dev/lib/test.hoon index 293e2f6054..e0e6f9fa70 100644 --- a/pkg/base-dev/lib/test.hoon +++ b/pkg/base-dev/lib/test.hoon @@ -38,7 +38,17 @@ =/ b (mule a) ?- -.b %| ~ - %& [leaf+"expected failure - succeeded" ~] + %& ['expected failure - succeeded' ~] + == +:: +expect-runs: kicks a trap, expecting success; returns trace on failure +:: +++ expect-success + |= a=(trap) + ^- tang + =/ b (mule a) + ?- -.b + %& ~ + %| ['expected success - failed' p.b] == :: $test-chain: a sequence of tests to be run ::