Files
LeetCode-Go/leetcode/0874.Walking-Robot-Simulation/874. Walking Robot Simulation_test.go
2021-05-08 16:29:09 +08:00

40 lines
629 B
Go

package leetcode
import "testing"
func Test_robotSim(t *testing.T) {
type args struct {
commands []int
obstacles [][]int
}
cases := []struct {
name string
args args
want int
}{
{
"case 1",
args{
commands: []int{4, -1, 3},
obstacles: [][]int{{}},
},
25,
},
{
"case 2",
args{
commands: []int{4, -1, 4, -2, 4},
obstacles: [][]int{{2, 4}},
},
65,
},
}
for _, tt := range cases {
t.Run(tt.name, func(t *testing.T) {
if got := robotSim(tt.args.commands, tt.args.obstacles); got != tt.want {
t.Errorf("robotSim() = %v, want %v", got, tt.want)
}
})
}
}