You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
511 B
Go
36 lines
511 B
Go
3 years ago
|
package main
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func Test_branch(t *testing.T) {
|
||
|
type args struct {
|
||
|
a int
|
||
|
b int
|
||
|
}
|
||
|
|
||
|
tests := []struct {
|
||
|
name string
|
||
|
args args
|
||
|
want int
|
||
|
}{
|
||
|
// TODO: Add test cases.
|
||
|
{
|
||
|
name: "a10",
|
||
|
args: args{a: 10},
|
||
|
want: 10,
|
||
|
},
|
||
|
{
|
||
|
name: "b10",
|
||
|
args: args{b: 10},
|
||
|
want: 20,
|
||
|
},
|
||
|
}
|
||
|
for _, tt := range tests {
|
||
|
t.Run(tt.name, func(t *testing.T) {
|
||
|
if got := branch(tt.args.a, tt.args.b); got != tt.want {
|
||
|
t.Errorf("branch() = %v, want %v", got, tt.want)
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|