This commit is contained in:
VicRen
2021-01-21 08:49:40 +08:00
parent 46297b22a7
commit 592c7c2686
2 changed files with 74 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package main
import "testing"
func Test_maxNumberOfBalloons(t *testing.T) {
type args struct {
text string
}
tests := []struct {
name string
args args
want int
}{
{
"test1",
args{
"nlaebolko",
},
1,
},
{
"test2",
args{
"loonbalxballpoon",
},
2,
},
{
"test3",
args{
"leetcode",
},
0,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := maxNumberOfBalloons(tt.args.text); got != tt.want {
t.Errorf("maxNumberOfBalloons() = %v, want %v", got, tt.want)
}
})
}
}