blob: 0cc9de3e97b3af624b22940fe962c0892eeeba3a (
plain)
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
|
package git
import (
"io/ioutil"
"os"
"path"
"testing"
)
func TestEntryCount(t *testing.T) {
repo := createTestRepo(t)
defer repo.Free()
defer os.RemoveAll(repo.Workdir())
err := ioutil.WriteFile(path.Join(path.Dir(repo.Path()), "hello.txt"), []byte("Hello, World"), 0644)
checkFatal(t, err)
statusList, err := repo.StatusList()
checkFatal(t, err)
entryCount, err := statusList.EntryCount()
checkFatal(t, err)
if entryCount != 1 {
t.Fatal("Incorrect number of status entries: ", entryCount)
}
}
|