(t *testing.T)
| 872 | } |
| 873 | |
| 874 | func TestReadComplex128(t *testing.T) { |
| 875 | var buf bytes.Buffer |
| 876 | wr := NewWriter(&buf) |
| 877 | rd := NewReader(&buf) |
| 878 | |
| 879 | for range 10 { |
| 880 | buf.Reset() |
| 881 | f := complex(rand.Float64()*math.MaxFloat64, rand.Float64()*math.MaxFloat64) |
| 882 | |
| 883 | wr.WriteComplex128(f) |
| 884 | err := wr.Flush() |
| 885 | if err != nil { |
| 886 | t.Fatal(err) |
| 887 | } |
| 888 | |
| 889 | out, err := rd.ReadComplex128() |
| 890 | if err != nil { |
| 891 | t.Error(err) |
| 892 | continue |
| 893 | } |
| 894 | if out != f { |
| 895 | t.Errorf("Wrote %f; read %f", f, out) |
| 896 | } |
| 897 | |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | func BenchmarkReadComplex128(b *testing.B) { |
| 902 | f := complex(rand.Float64(), rand.Float64()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…