1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-02 09:12:44 +08:00

fix minor mfs truncate bug

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2016-02-19 18:57:41 -08:00
parent 8e4cfed05a
commit 973707a884
4 changed files with 35 additions and 2 deletions

View File

@ -6,8 +6,8 @@ import (
"io"
"os"
proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto"
mh "gx/ipfs/QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku/go-multihash"
proto "gx/ipfs/QmZ4Qi3GaRbjcx28Sme5eMH7RQjGkt8wHxt2a65oLaeFEV/gogo-protobuf/proto"
context "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
key "github.com/ipfs/go-ipfs/blocks/key"

View File

@ -447,6 +447,20 @@ func TestDagTruncate(t *testing.T) {
if size != 10 {
t.Fatal("size was incorrect!")
}
err = dagmod.Truncate(0)
if err != nil {
t.Fatal(err)
}
size, err = dagmod.Size()
if err != nil {
t.Fatal(err)
}
if size != 0 {
t.Fatal("size was incorrect!")
}
}
func TestSparseWrite(t *testing.T) {