From b285ebe407750f2533ac1bdc1ffcda60feed3780 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Thu, 16 Apr 2020 09:08:03 -0400 Subject: [PATCH] test: +expect-yes, +expect-crash --- pkg/arvo/lib/test.hoon | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/arvo/lib/test.hoon b/pkg/arvo/lib/test.hoon index 7e4eca44a5..16d90cd5a0 100644 --- a/pkg/arvo/lib/test.hoon +++ b/pkg/arvo/lib/test.hoon @@ -1,6 +1,20 @@ :: testing utilities meant to be directly used from files in %/tests :: |% +++ expect-yes + |= [message=tape actual=?] + ^- tang + ?: actual ~ + [leaf+message]~ +:: +++ expect-crash + |* [message=tape go=(trap)] + ^- tang + =/ res (mule go) + ?- -.res + %| ~ + %& ~[leaf+"expected crash" leaf+message] + == :: +expect-eq: compares :expected and :actual and pretty-prints the result :: ++ expect-eq