summaryrefslogtreecommitdiff
path: root/status_test.go
diff options
context:
space:
mode:
authorBen Navetta <[email protected]>2014-08-18 22:19:06 -0400
committerBen Navetta <[email protected]>2014-08-18 22:19:06 -0400
commitf954871968ca6df54aab26d6984cc42bb3904ef2 (patch)
treed3be84e3bcfedd8c2974876e3d8280ef68f592b4 /status_test.go
parentb831ae04aaf3af900fe39a93193aa6404ebf4c29 (diff)
start on status tests; fix bug in Repository.StatusList()
Diffstat (limited to 'status_test.go')
-rw-r--r--status_test.go27
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)
+ }
+}