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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user