diff options
| author | demo <demo@antix1> | 2026-05-30 11:19:07 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-30 11:19:07 -0400 |
| commit | a7822e4da505e1aac12cd487a2b791ef1fe2cd41 (patch) | |
| tree | 207daa18729745f56c87a372748507f2d1f85092 | |
| parent | 859af872373e4768e19c37cabe1b988f69bee070 (diff) | |
test: write a few real tests
| -rw-r--r-- | hamlet_test.go | 16 |
1 files changed, 11 insertions, 5 deletions
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) + } } |
