summaryrefslogtreecommitdiff
path: root/hamlet_test.go
blob: bbd50fe1b96aa34dc51820d5c6e25ee46a0a6822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package hamlet

import (
	"testing"
)

func TestAssertion(t *testing.T) {
	p := Present("")
	q := Present(4)

	theorem1 := If(p, q)
	if !theorem1.Assert() {
		t.Errorf("want %t, got %t", true, false)
	}

	theorem2 := If(q, p)
	if theorem2.Assert() {
		t.Errorf("want %t, got %t", false, true)
	}

	theorem3 := Xor(p, q)
	if !theorem3.Assert() {
		t.Errorf("want %t, got %t", true, false)
	}
}