MCPcopy
hub / github.com/dropbox/godropbox / Generate

Method Generate

database/sqltypes/sqltypes_test.go:423–443  ·  view source on GitHub ↗
(rand *rand.Rand, size int)

Source from the content-addressed store, hash-verified

421}
422
423func (v Value) Generate(rand *rand.Rand, size int) reflect.Value {
424 buildFunc := func(goval interface{}) Value {
425 v, _ := BuildValue(goval)
426 return v
427 }
428
429 switch rand.Intn(5) {
430 case 0:
431 return reflect.ValueOf(buildFunc(nil))
432 case 1:
433 return reflect.ValueOf(buildFunc(rand.Int()))
434 case 2:
435 return reflect.ValueOf(buildFunc(rand.NormFloat64()))
436 case 3:
437 return reflect.ValueOf(buildFunc("string"))
438 case 4:
439 return reflect.ValueOf(buildFunc([]byte("[]byte")))
440 }
441
442 return reflect.ValueOf(buildFunc(nil))
443}
444
445func TestMarshalUnmarshalBinary(t *testing.T) {
446 f := func(v Value) bool {

Callers

nothing calls this directly

Calls 1

BuildValueFunction · 0.85

Tested by

no test coverage detected