(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestTalbotLinHanrahan(t *testing.T) { |
| 238 | for _, test := range talbotLinHanrahanTests { |
| 239 | values, step, _, magnitude := talbotLinHanrahan(test.dMin, test.dMax, test.want, test.containment, nil, nil, nil) |
| 240 | if !reflect.DeepEqual(values, test.wantValues) { |
| 241 | t.Errorf("unexpected values for dMin=%g, dMax=%g, want=%d, containment=%d:\ngot: %v\nwant:%v", |
| 242 | test.dMin, test.dMax, test.want, test.containment, values, test.wantValues) |
| 243 | } |
| 244 | if step != test.wantStep { |
| 245 | t.Errorf("unexpected step for dMin=%g, dMax=%g, want=%d, containment=%d: got:%v want:%v", |
| 246 | test.dMin, test.dMax, test.want, test.containment, step, test.wantStep) |
| 247 | } |
| 248 | if magnitude != test.wantMagnitude { |
| 249 | t.Errorf("unexpected magnitude for dMin=%g, dMax=%g, want=%d, containment=%d: got:%d want:%d", |
| 250 | test.dMin, test.dMax, test.want, test.containment, magnitude, test.wantMagnitude) |
| 251 | } |
| 252 | if test.containment == containData { |
| 253 | f := math.Pow10(-magnitude) |
| 254 | if test.containment == containData && (test.dMin*f < values[0]*f || values[len(values)-1]*f < test.dMax*f) { |
| 255 | t.Errorf("unexpected values for containment dMin=%g, dMax=%g, want=%d not containment:\ngot: %v\nwant:%v", |
| 256 | test.dMin, test.dMax, test.want, values, test.wantValues) |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | } |
nothing calls this directly
no test coverage detected