Skip to content

Commit 75d1e15

Browse files
committed
add: leetcode 0520 test
1 parent 761469a commit 75d1e15

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package leetcode
2+
3+
import (
4+
"fmt"
5+
"testing"
6+
)
7+
8+
type question520 struct {
9+
para520
10+
ans520
11+
}
12+
13+
// para 是参数
14+
type para520 struct {
15+
word string
16+
}
17+
18+
// ans 是答案
19+
type ans520 struct {
20+
ans bool
21+
}
22+
23+
func Test_Problem520(t *testing.T) {
24+
25+
qs := []question520{
26+
27+
{
28+
para520{"USA"},
29+
ans520{true},
30+
},
31+
32+
{
33+
para520{"FlaG"},
34+
ans520{false},
35+
},
36+
}
37+
38+
fmt.Printf("------------------------Leetcode Problem 520------------------------\n")
39+
40+
for _, q := range qs {
41+
_, p := q.ans520, q.para520
42+
fmt.Printf("【input】:%v 【output】:%v\n", p, detectCapitalUse(p.word))
43+
}
44+
fmt.Printf("\n\n\n")
45+
}

0 commit comments

Comments
 (0)