1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-21 15:17:01 +00:00

test: Add small miscellaneous tests

This patch extends various packages and integration tests, increasing
test coverage. They're small enough that it's not worth splitting them
up, as it would add a lot of noise to the history.
This commit is contained in:
Alberto Bertogli
2018-03-02 16:14:10 +00:00
parent d80c76f746
commit 0611b7a7fc
7 changed files with 149 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
package protoio
import (
"os"
"testing"
"blitiri.com.ar/go/chasquid/internal/protoio/testpb"
@@ -73,6 +74,15 @@ func TestStore(t *testing.T) {
t.Errorf("Get(notexists): %v - %v", ok, err)
}
// Add an extraneous file, which ListIDs should ignore.
fd, err := os.Create(dir + "/store/" + "somefile")
if fd != nil {
fd.Close()
}
if err != nil {
t.Errorf("failed to create extraneous file: %v", err)
}
if ids, err := st.ListIDs(); len(ids) != 1 || ids[0] != "f" || err != nil {
t.Errorf("expected [f], got %v - %v", ids, err)
}