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

Function Test3x8Decoder

components/decoders_test.go:21–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19}
20
21func Test3x8Decoder(t *testing.T) {
22 decoder := NewDecoder3x8()
23
24 expected := func(onIndex int, size int) []bool {
25 result := make([]bool, size)
26 result[onIndex] = true
27 return result
28 }
29
30 decoder.Update(false, false, false)
31 checkDecoder3x8Output(decoder, expected(0, 16), t)
32
33 decoder.Update(false, false, true)
34 checkDecoder3x8Output(decoder, expected(1, 16), t)
35
36 decoder.Update(false, true, false)
37 checkDecoder3x8Output(decoder, expected(2, 16), t)
38
39 decoder.Update(false, true, true)
40 checkDecoder3x8Output(decoder, expected(3, 16), t)
41
42 decoder.Update(true, false, false)
43 checkDecoder3x8Output(decoder, expected(4, 16), t)
44
45 decoder.Update(true, false, true)
46 checkDecoder3x8Output(decoder, expected(5, 16), t)
47
48 decoder.Update(true, true, false)
49 checkDecoder3x8Output(decoder, expected(6, 16), t)
50
51 decoder.Update(true, true, true)
52 checkDecoder3x8Output(decoder, expected(7, 16), t)
53}
54
55func Test4x16Decoder(t *testing.T) {
56 decoder := NewDecoder4x16()

Callers

nothing calls this directly

Calls 3

UpdateMethod · 0.95
NewDecoder3x8Function · 0.85
checkDecoder3x8OutputFunction · 0.85

Tested by

no test coverage detected