av/cmd/vidforward/vidforward_test.go

50 lines
1.4 KiB
Go
Raw Normal View History

/*
DESCRIPTION
Provides testing for vidforward 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.
*/
package main
import "testing"
// TestIsMac tests the isMac function.
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)
}
}
}