summaryrefslogtreecommitdiff
path: root/status_test.go
diff options
context:
space:
mode:
authorBen Navetta <[email protected]>2014-08-18 23:12:45 -0400
committerBen Navetta <[email protected]>2014-08-18 23:12:45 -0400
commit8fd7c2c60940300b125c40213c82b26dd38e7a78 (patch)
treee6da649d702a6de703e25f7336118254b6620076 /status_test.go
parenta093e20a8812f2cc26fde6d4bc6ee8c21e782c39 (diff)
add StatusFile function
Diffstat (limited to 'status_test.go')
-rw-r--r--status_test.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/status_test.go b/status_test.go
index 3fababe..13b778c 100644
--- a/status_test.go
+++ b/status_test.go
@@ -7,12 +7,28 @@ import (
"testing"
)
+func TestStatusFile(t *testing.T) {
+ repo := createTestRepo(t)
+ defer repo.Free()
+ defer os.RemoveAll(repo.Workdir())
+
+ err := ioutil.WriteFile(path.Join(path.Dir(repo.Workdir()), "hello.txt"), []byte("Hello, World"), 0644)
+ checkFatal(t, err)
+
+ status, err := repo.StatusFile("hello.txt")
+ checkFatal(t, err)
+
+ if status != StatusWtNew {
+ t.Fatal("Incorrect status flags: ", status)
+ }
+}
+
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)
+ err := ioutil.WriteFile(path.Join(path.Dir(repo.Workdir()), "hello.txt"), []byte("Hello, World"), 0644)
checkFatal(t, err)
statusList, err := repo.StatusList(nil)