From a5f779d8f9f124a339dfcc5a681e3ee4d38c7a06 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 21 May 2020 14:28:06 -0700 Subject: [PATCH] test: adds trivial unit tests for nock 6 invariants --- pkg/arvo/tests/sys/hoon/mock.hoon | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkg/arvo/tests/sys/hoon/mock.hoon diff --git a/pkg/arvo/tests/sys/hoon/mock.hoon b/pkg/arvo/tests/sys/hoon/mock.hoon new file mode 100644 index 000000000..411ffa592 --- /dev/null +++ b/pkg/arvo/tests/sys/hoon/mock.hoon @@ -0,0 +1,32 @@ +/+ *test +|% +:: nock 6 should allow invalid formulas in unevaluated branches +:: +++ test-conditional-skips + ;: weld + %+ expect-eq + !> 43 + !> .*(~ [%6 [%1 1] 0 [%1 43]]) + :: + %- expect-fail + |. .*(~ [%6 [%1 0] 0 [%1 43]]) + :: + %+ expect-eq + !> 42 + !> .*(~ [%6 [%1 0] [%1 42] 0]) + :: + %- expect-fail + |. .*(~ [%6 [%1 1] [%1 42] 0]) + :: + %+ expect-eq + !> 42 + !> .*(~ [%6 [%1 0] [%1 42] %1 43]) + :: + %+ expect-eq + !> 43 + !> .*(~ [%6 [%1 1] [%1 42] %1 43]) + :: + %- expect-fail + |. .*(~ [%6 [%1 2] [%1 42] %1 43]) + == +--