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

Function TestInvertedScale_Normalize

axis_test.go:142–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestInvertedScale_Normalize(t *testing.T) {
143 inverter := InvertedScale{Normalizer: LinearScale{}}
144 if got := inverter.Normalize(0, 1, 1); got != 0.0 {
145 t.Errorf("Expected a normalization inversion %f->%f not %f", 1.0, 0.0, got)
146 }
147 if got := inverter.Normalize(0, 1, .5); got != 0.5 {
148 t.Errorf("Expected a normalization inversion %f->%f not %f", 0.5, 0.5, got)
149 }
150 if got := inverter.Normalize(0, 1, 0); got != 1.0 {
151 t.Errorf("Expected a normalization inversion %f->%f not %f", 0.0, 1.0, got)
152 }
153}
154
155func TestAxisPadding(t *testing.T) {
156 for _, padding := range []int{0, 5, 10} {

Callers

nothing calls this directly

Calls 1

NormalizeMethod · 0.95

Tested by

no test coverage detected