Example #1
0
func TestAsAFile(t *testing.T) {
	Size = 128
	debug = testing.Verbose()
	var b Blocks
	bo, err := b.Open()
	if err != nil {
		t.Fatalf("open: %s", err)
	}
	rwtest.AsAFile(t, bo, 100, 5*KiB, 128)
}
Example #2
0
func AsAFile(t Fataler, fss ...zx.Tree) {
	if len(fss) == 0 {
		t.Fatalf("no fs given")
	}
	fs := fss[0].(zx.RWTree)
	dat := []byte{}
	if err := zx.PutAll(fs, "/testfile", zx.Dir{"mode": "0640"}, dat); err != nil {
		t.Fatalf("put all: %s", err)
	}
	zxf := NewFakeOSFile(fs, "/testfile")
	rwtest.AsAFile(t, zxf, 1000, 128*1024, 3803)
}