From c48c2f4b6accc3b08f092b3b23798d1df731ece6 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 19 Aug 2022 02:37:33 +0300 Subject: [PATCH] /lib/test: add +run-chain for test sequences --- .../lib/test/ames-gall.hoon} | 0 pkg/base-dev/lib/test.hoon | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+) rename pkg/{base-dev/lib/vane-test.hoon => arvo/lib/test/ames-gall.hoon} (100%) diff --git a/pkg/base-dev/lib/vane-test.hoon b/pkg/arvo/lib/test/ames-gall.hoon similarity index 100% rename from pkg/base-dev/lib/vane-test.hoon rename to pkg/arvo/lib/test/ames-gall.hoon diff --git a/pkg/base-dev/lib/test.hoon b/pkg/base-dev/lib/test.hoon index ec97e71dd..293e2f605 100644 --- a/pkg/base-dev/lib/test.hoon +++ b/pkg/base-dev/lib/test.hoon @@ -40,6 +40,26 @@ %| ~ %& [leaf+"expected failure - succeeded" ~] == +:: $test-chain: a sequence of tests to be run +:: ++$ test-chain + $_ + |? + ?: =(0 0) + [%& p=*tang] + [%| p=[tang=*tang next=^?(..$)]] +:: +run-chain: run a sequence of tests, stopping at first failure +:: +++ run-chain + |= seq=test-chain + ^- tang + =/ res $:seq + ?- -.res + %& p.res + %| ?. =(~ tang.p.res) + tang.p.res + $(seq next.p.res) + == :: +category: prepends a name to an error result; passes successes unchanged :: ++ category