Reformat code
This commit is contained in:
@ -3,8 +3,8 @@ package mode
|
||||
import "testing"
|
||||
|
||||
func TestToString(t *testing.T) {
|
||||
cases := []struct{
|
||||
value DriveMode
|
||||
cases := []struct {
|
||||
value DriveMode
|
||||
expected string
|
||||
}{
|
||||
{DriveModeUser, "user"},
|
||||
@ -12,28 +12,28 @@ func TestToString(t *testing.T) {
|
||||
{DriveModeInvalid, ""},
|
||||
}
|
||||
|
||||
for _, c := range cases{
|
||||
for _, c := range cases {
|
||||
val := ToString(c.value)
|
||||
if val != c.expected{
|
||||
if val != c.expected {
|
||||
t.Errorf("ToString(%v): %v, wants %v", c.value, val, c.expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseString(t *testing.T) {
|
||||
cases := []struct{
|
||||
value string
|
||||
cases := []struct {
|
||||
value string
|
||||
expected DriveMode
|
||||
}{
|
||||
{"user", DriveModeUser},
|
||||
{"pilot",DriveModePilot},
|
||||
{"pilot", DriveModePilot},
|
||||
{"", DriveModeInvalid},
|
||||
{"invalid", DriveModeInvalid},
|
||||
}
|
||||
|
||||
for _, c := range cases{
|
||||
for _, c := range cases {
|
||||
val := ParseString(c.value)
|
||||
if val != c.expected{
|
||||
if val != c.expected {
|
||||
t.Errorf("ParseString(%v): %v, wants %v", c.value, val, c.expected)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user