File: status_test.go

package info (click to toggle)
gitbatch 0.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 504 kB
  • sloc: makefile: 10; sh: 1
file content (51 lines) | stat: -rw-r--r-- 1,046 bytes parent folder | download | duplicates (2)
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
package command

import (
	"testing"

	"github.com/isacikgoz/gitbatch/core/git"
)

func TestStatusWithGit(t *testing.T) {
	defer cleanRepo()
	r, err := testRepo()
	if err != nil {
		t.Fatalf("Test Failed. error: %s", err.Error())
	}
	_, err = testFile("file")
	if err != nil {
		t.Fatalf("Test Failed. error: %s", err.Error())
	}
	var tests = []struct {
		input *git.Repository
	}{
		{r},
	}
	for _, test := range tests {
		if output, err := statusWithGit(test.input); err != nil || len(output) <= 0 {
			t.Errorf("Test Failed. error: %s", err.Error())
		}
	}
}

func TestStatusWithGoGit(t *testing.T) {
	defer cleanRepo()
	r, err := testRepo()
	if err != nil {
		t.Fatalf("Test Failed. error: %s", err.Error())
	}
	_, err = testFile("file")
	if err != nil {
		t.Fatalf("Test Failed. error: %s", err.Error())
	}
	var tests = []struct {
		input *git.Repository
	}{
		{r},
	}
	for _, test := range tests {
		if output, err := statusWithGoGit(test.input); err != nil || len(output) <= 0 {
			t.Errorf("Test Failed. error: %s", err.Error())
		}
	}
}