Skip to content

Commit f0a086f

Browse files
committed
test: add test case for Merge
1 parent a9b7d8d commit f0a086f

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

commit-msg_test.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,26 @@ func TestGetMsg(t *testing.T) {
1111
}
1212
}
1313

14-
func TestValidateSample(t *testing.T) {
14+
func TestValidatedSample(t *testing.T) {
1515
defer func() {
1616
err := recover()
1717
state, ok := err.(msgState)
18-
if !ok || state > Merge {
18+
if !ok || state != Validated {
1919
t.Errorf("Failed! %v", err)
2020
}
2121
}()
2222

2323
validateMsg(getMsg("testcase/sample.txt"))
2424
}
25+
26+
func TestTortoiseGitMerge(t *testing.T) {
27+
defer func() {
28+
err := recover()
29+
state, ok := err.(msgState)
30+
if !ok || state != Merge {
31+
t.Errorf("Failed! %v", err)
32+
}
33+
}()
34+
35+
validateMsg(getMsg("testcase/tortoiseGitMerge.txt"))
36+
}

testcase/tortoiseGitMerge.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Merge remote-tracking branch 'remotes/origin/feat_xyz'

0 commit comments

Comments
 (0)