2022-09-20 09:24:59 +03:00
|
|
|
/*
|
|
|
|
DESCRIPTION
|
|
|
|
Provides testing for vidfoward functionality.
|
|
|
|
|
|
|
|
AUTHORS
|
|
|
|
Saxon A. Nelson-Milton <saxon@ausocean.org>
|
|
|
|
|
|
|
|
LICENSE
|
|
|
|
Copyright (C) 2022 the Australian Ocean Lab (AusOcean)
|
|
|
|
|
|
|
|
It is free software: you can redistribute it and/or modify them
|
|
|
|
under the terms of the GNU General Public License as published by the
|
|
|
|
Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with revid in gpl.txt. If not, see http://www.gnu.org/licenses.
|
|
|
|
*/
|
|
|
|
|
2022-09-09 04:54:29 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
2022-09-20 09:24:59 +03:00
|
|
|
// TestIsMac tests the isMac function.
|
2022-09-09 04:54:29 +03:00
|
|
|
func TestIsMac(t *testing.T) {
|
2022-09-20 09:24:59 +03:00
|
|
|
tests := []struct {
|
2022-09-09 04:54:29 +03:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|