(rand *rand.Rand, size int)
| 421 | } |
| 422 | |
| 423 | func (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 | |
| 445 | func TestMarshalUnmarshalBinary(t *testing.T) { |
| 446 | f := func(v Value) bool { |
nothing calls this directly
no test coverage detected