func TestValid(t *testing.T) {
	bmtHashOfFoo := "2387e8e7d8a48c2a9339c97c1dc3461a9a7aa07e994c5cb8b38fd7c1b3e6ea48"
	address := swarm.MustParseHexAddress(bmtHashOfFoo)

	foo := "foo"
	fooLength := len(foo)
	fooBytes := make([]byte, swarm.SpanSize+fooLength)
	binary.LittleEndian.PutUint64(fooBytes, uint64(fooLength))
	copy(fooBytes[swarm.SpanSize:], foo)
	ch := swarm.NewChunk(address, fooBytes)
	if !cac.Valid(ch) {
		t.Fatalf("data '%s' should have validated to hash '%s'", ch.Data(), ch.Address())
	}
}
// TestValid checks whether a chunk is a valid content-addressed chunk
TestValid checks whether a chunk is a valid content-addressed chunk
// TestValid checks whether a chunk is a valid content - addressed chunk
func TestValid(t *testing.T) {
	bmtHashOfFoo := "2387e8e7d8a48c2a9339c97c1dc3461a9a7aa07e994c5cb8b38fd7c1b3e6ea48"
	address := swarm.MustParseHexAddress(bmtHashOfFoo)
	foo := "foo"
	fooLength := len(foo)
	fooBytes := make([]byte, swarm.SpanSize+fooLength)
	binary.LittleEndian.PutUint64(fooBytes, uint64(fooLength))
	copy(fooBytes[swarm.SpanSize:], foo)
	ch := swarm.NewChunk(address, fooBytes)
	if !cac.Valid(ch) {
		t.Fatalf("data '%s' should have validated to hash '%s'", ch.Data(), ch.Address())
	}
}
func TestValid ( t * testing . T ) { bmtHashOfFoo := " " address := swarm . MustParseHexAddress ( bmtHashOfFoo ) foo := " " fooLength := len ( foo ) fooBytes := make ( [ ] byte , swarm . SpanSize + fooLength ) binary . LittleEndian . PutUint64 ( fooBytes , uint64 ( fooLength ) ) copy ( fooBytes [ swarm . SpanSize : ] , foo ) ch := swarm . NewChunk ( address , fooBytes ) if ! cac . Valid ( ch ) { t . Fatalf ( " " , ch . Data ( ) , ch . Address ( ) ) } }
TestValid checks whether a chunk is a valid content-addressed chunk
TestValid checks whether a chunk is a valid content - addressed chunk