package sentio import "testing" func TestSideFromString(t *testing.T) { tests := []struct { arg string want Side wantErr bool }{ { arg: "short", want: SHORT, wantErr: false, }, { arg: "Short", want: SHORT, wantErr: false, }, { arg: " short ", want: SHORT, wantErr: false, }, { arg: "ShOrT", want: SHORT, wantErr: false, }, { arg: "šhort", want: -1, wantErr: true, }, } for _, tt := range tests { t.Run("TestSideFromString", func(t *testing.T) { got, err := ParseSide(tt.arg) if (err != nil) != tt.wantErr { t.Errorf("SideFromString() error = %v, wantErr %v", err, tt.wantErr) return } if got != tt.want { t.Errorf("SideFromString() got = %v, want %v", got, tt.want) } }) } }