Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9688034

Browse files
authored
Merge pull request6boris#124 from kylesliu/develop
Develop
2 parentsb9f3f29 +4392353 commit9688034

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

‎cmd/template/solution/Solution.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package Solution
2+
3+
funcSolution(xbool)bool {
4+
returnx
5+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package Solution
2+
3+
import (
4+
"reflect"
5+
"strconv"
6+
"testing"
7+
)
8+
9+
funcTestSolution(t*testing.T) {
10+
//测试用例
11+
cases:= []struct {
12+
namestring
13+
inputsbool
14+
expectbool
15+
}{
16+
{"TestCase",true,true},
17+
{"TestCase",true,true},
18+
{"TestCase",false,false},
19+
}
20+
21+
//开始测试
22+
fori,c:=rangecases {
23+
t.Run(c.name+" "+strconv.Itoa(i),func(t*testing.T) {
24+
got:=Solution(c.inputs)
25+
if!reflect.DeepEqual(got,c.expect) {
26+
t.Fatalf("expected: %v, but got: %v, with inputs: %v",
27+
c.expect,got,c.inputs)
28+
}
29+
})
30+
}
31+
}
32+
33+
//压力测试
34+
funcBenchmarkSolution(b*testing.B) {
35+
36+
}
37+
38+
//使用案列
39+
funcExampleSolution() {
40+
41+
}

‎generate.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ git pull
1919
#all-contributors add kylesliu code,blog,design,doc
2020
#all-contributors generate
2121

22-
#rm -rfpublic
22+
rm -rfpublic_new
2323
rm -rf gitbook
2424

25-
#mkdirpublic
25+
mkdirpublic_new
2626
mkdir gitbook
2727

2828
cp -rfv src/* gitbook
2929
cp README.md gitbook
3030
cp SUMMARY.md gitbook
3131
cp SUMMARY-LIST.md gitbook
3232
cp CONTRIBUTOR.md gitbook
33-
gitbook build --config book.json gitbookpublic --timing --log debug
33+
gitbook build --config book.json gitbookpublic_new --timing --log debug
3434
#gitbook serve --config book.json gitbook public
3535

3636
# nohup sh generate.sh >generate.log 2>&1 &
37+
38+
rm -rf public&& mv public_new public

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp