MCPcopy Create free account
hub / github.com/djhworld/simple-computer / TestNOTGate

Function TestNOTGate

circuit/gates_test.go:61–75  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

59}
60
61func TestNOTGate(t *testing.T) {
62 combinations := [][]bool{
63 []bool{false, true},
64 []bool{true, false},
65 }
66
67 for _, combination := range combinations {
68 gate1 := NewNOTGate()
69 gate1.Update(combination[0])
70
71 if gate1.output.Get() != combination[1] {
72 t.Fail()
73 }
74 }
75}
76
77func TestXORGate(t *testing.T) {
78 combinations := [][]bool{

Callers

nothing calls this directly

Calls 3

UpdateMethod · 0.95
NewNOTGateFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected