-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
95 lines (75 loc) · 1.25 KB
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package main
import (
"os"
"testing"
"github.com/deeper-x/svm/git"
)
func TestShow(t *testing.T) {
os.Args = []string{"svm", "show"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestPatch(t *testing.T) {
os.Args = []string{"svm", "patch"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestMinor(t *testing.T) {
os.Args = []string{"svm", "minor"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestMajor(t *testing.T) {
os.Args = []string{"svm", "major"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestUndo(t *testing.T) {
os.Args = []string{"svm", "undo"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestAll(t *testing.T) {
os.Args = []string{"svm", "all"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestWritre(t *testing.T) {
os.Args = []string{"svm", "write", "test/out_file.txt"}
_, err := svm()
if err != nil {
t.Error(err)
}
}
func TestSetNewVer(t *testing.T) {
tag, err := git.NewTag()
if err != nil {
t.Error(err)
}
err = tag.SetNewVer("v1.100.0")
if err != nil {
t.Error(err)
}
}
func TestDelVer(t *testing.T) {
tag, err := git.NewTag()
if err != nil {
t.Error(err)
}
err = tag.DelVer("v1.100.0")
if err != nil {
t.Error(err)
}
}