MCPcopy Index your code
hub / github.com/gonum/plot / TestTalbotLinHanrahan

Function TestTalbotLinHanrahan

labelling_test.go:237–260  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

235}
236
237func 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}

Callers

nothing calls this directly

Calls 1

talbotLinHanrahanFunction · 0.85

Tested by

no test coverage detected