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

Function TestTickerFunc_Ticks

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

Source from the content-addressed store, hash-verified

111}
112
113func TestTickerFunc_Ticks(t *testing.T) {
114 type args struct {
115 min float64
116 max float64
117 }
118 tests := []struct {
119 name string
120 args args
121 want []Tick
122 f TickerFunc
123 }{
124 {
125 name: "return exactly the same ticks as the function passed to TickerFunc",
126 args: args{0, 3},
127 want: []Tick{{1, "a"}, {2, "b"}},
128 f: func(min, max float64) []Tick {
129 return []Tick{{1, "a"}, {2, "b"}}
130 },
131 },
132 }
133 for _, tt := range tests {
134 t.Run(tt.name, func(t *testing.T) {
135 if got := tt.f.Ticks(tt.args.min, tt.args.max); !reflect.DeepEqual(got, tt.want) {
136 t.Errorf("TickerFunc.Ticks() = %v, want %v", got, tt.want)
137 }
138 })
139 }
140}
141
142func TestInvertedScale_Normalize(t *testing.T) {
143 inverter := InvertedScale{Normalizer: LinearScale{}}

Callers

nothing calls this directly

Calls 1

TicksMethod · 0.65

Tested by

no test coverage detected