mirror of
https://github.com/hairyhenderson/go-onerng.git
synced 2025-04-04 17:50:12 -05:00
35 lines
720 B
Go
35 lines
720 B
Go
package onerng
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestNoiseCommand(t *testing.T) {
|
|
fmt.Println(DisableWhitener)
|
|
fmt.Println(EnableRF)
|
|
fmt.Println(DisableAvalanche)
|
|
|
|
fmt.Println(Default)
|
|
fmt.Println(Silent)
|
|
|
|
testdata := []struct {
|
|
flags ReadMode
|
|
cmd string
|
|
}{
|
|
{Default, "cmd0\n"},
|
|
{DisableWhitener, "cmd1\n"},
|
|
{EnableRF, "cmd2\n"},
|
|
{EnableRF | DisableWhitener, "cmd3\n"},
|
|
{DisableAvalanche, "cmd4\n"},
|
|
{DisableAvalanche | DisableWhitener, "cmd5\n"},
|
|
{DisableAvalanche | EnableRF, "cmd6\n"},
|
|
{DisableAvalanche | EnableRF | DisableWhitener, "cmd7\n"},
|
|
}
|
|
for _, d := range testdata {
|
|
assert.Equal(t, d.cmd, NoiseCommand(d.flags), d.cmd, d.flags)
|
|
}
|
|
}
|