This commit is contained in:
Chris Lu 2019-10-29 00:37:15 -07:00
parent 19b6a16003
commit cd7ce720c7

View file

@ -5,6 +5,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/chrislusf/seaweedfs/weed/storage/backend"
"github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/storage/types"
) )
@ -54,7 +55,10 @@ func TestAppend(t *testing.T) {
os.Remove(tempFile.Name()) os.Remove(tempFile.Name())
}() }()
offset, _, _, _ := n.Append(tempFile, CurrentVersion) datBackend := backend.NewDiskFile(tempFile.Name(), tempFile)
defer datBackend.Close()
offset, _, _, _ := n.Append(datBackend, CurrentVersion)
if offset != uint64(fileSize) { if offset != uint64(fileSize) {
t.Errorf("Fail to Append Needle.") t.Errorf("Fail to Append Needle.")
} }