diff options
Diffstat (limited to 'status_test.go')
| -rw-r--r-- | status_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/status_test.go b/status_test.go new file mode 100644 index 0000000..0cc9de3 --- /dev/null +++ b/status_test.go @@ -0,0 +1,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) + } +} |
