mirror of https://bitbucket.org/ausocean/av.git
25 lines
545 B
Go
25 lines
545 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestIsMac(t *testing.T) {
|
|
tests := []struct{
|
|
in string
|
|
want bool
|
|
}{
|
|
{in: "00:00:00:00:00:00", want: false},
|
|
{in: "00000:00:00:00:01", want: false},
|
|
{in: "00:00:00:00000:01", want: false},
|
|
{in: "15:b5:c7:cg:87:92", want: false},
|
|
{in: "00:00:00:00:00", want: false},
|
|
{in: "7d:ac:cf:84:e8:01", want: true},
|
|
}
|
|
|
|
for i, test := range tests {
|
|
got := isMac(test.in)
|
|
if test.want != got {
|
|
t.Errorf("did not get expected result for test %d\ngot: %v\nwant: %v", i, got, test.want)
|
|
}
|
|
}
|
|
}
|