mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-10-31 20:09:02 +00:00
30 lines
443 B
Go
30 lines
443 B
Go
package component
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestByteToPins(t *testing.T) {
|
|
v := uint8(0b10010110)
|
|
a := [8]bool{
|
|
false, true, true, false,
|
|
true, false, false, true,
|
|
}
|
|
|
|
if a != ByteToPins(v) {
|
|
t.Error("Error on byte to pins")
|
|
}
|
|
}
|
|
|
|
func TestPinsToByte(t *testing.T) {
|
|
v := uint8(0b10010110)
|
|
a := [8]bool{
|
|
false, true, true, false,
|
|
true, false, false, true,
|
|
}
|
|
|
|
if v != PinsToByte(a) {
|
|
t.Error("Error on pins to byte")
|
|
}
|
|
}
|