From a7822e4da505e1aac12cd487a2b791ef1fe2cd41 Mon Sep 17 00:00:00 2001 From: demo Date: Sat, 30 May 2026 11:19:07 -0400 Subject: test: write a few real tests --- hamlet_test.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'hamlet_test.go') diff --git a/hamlet_test.go b/hamlet_test.go index d216617..cdbae0d 100644 --- a/hamlet_test.go +++ b/hamlet_test.go @@ -1,14 +1,20 @@ package hamlet import ( - "fmt" "testing" ) func TestAssertion(t *testing.T) { - prop1 := New(4) - prop2 := New("") + p := New("") + q := New(4) - fmt.Println(If(prop2, prop1)) - fmt.Println(If(prop1, prop2)) + theorem1 := If(p, q) + if v := theorem1.Value(); !v { + t.Errorf("want %t, got %t", true, false) + } + + theorem2 := If(q, p) + if v := theorem2.Value(); v { + t.Errorf("want %t, got %t", false, true) + } } -- cgit v1.2.3