Skip to content

Commit 929cbc5

Browse files
committed
添加平台判断测试
1 parent eec934f commit 929cbc5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cmd/contribution_test.go

+21
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,50 @@ package main
22

33
import (
44
"fmt"
5+
"runtime"
56
"testing"
67
)
78

89
func TestGetContributorString(t *testing.T) {
10+
if runtime.GOOS != "windows" {
11+
return
12+
}
13+
914
str := GetContributorString()
1015
fmt.Println(str)
1116
}
1217

1318
func TestGetContributorJosnMarshal(t *testing.T) {
19+
if runtime.GOOS != "windows" {
20+
return
21+
}
22+
1423
str := GetContributorJosnMarshal("", " ")
1524
fmt.Println(str)
1625
}
1726

1827
func TestGetContributorInstance(t *testing.T) {
28+
if runtime.GOOS != "windows" {
29+
return
30+
}
31+
1932
contributors := GetContributorInstance()
2033
fmt.Println(contributors)
2134
}
2235

2336
func TestGenerateContributorTemplete(t *testing.T) {
37+
if runtime.GOOS != "windows" {
38+
return
39+
}
40+
2441
GenerateContributorTemplete()
2542
}
2643

2744
func BenchmarkGetContributorInstance(b *testing.B) {
45+
if runtime.GOOS != "windows" {
46+
return
47+
}
48+
2849
b.N = 2000000
2950
contributors := GetContributorInstance()
3051
fmt.Println(contributors)

0 commit comments

Comments
 (0)