| 76 | } |
| 77 | |
| 78 | func TestAxisSmallTick(t *testing.T) { |
| 79 | d := DefaultTicks{} |
| 80 | for i, test := range axisSmallTickTests { |
| 81 | ticks := d.Ticks(test.min, test.max) |
| 82 | gotLabels := labelsOf(ticks) |
| 83 | gotValues := valuesOf(ticks) |
| 84 | if !reflect.DeepEqual(gotValues, test.wantValues) { |
| 85 | t.Errorf("tick values mismatch %d:\ngot: %v\nwant:%v", i, gotValues, test.wantValues) |
| 86 | } |
| 87 | if !reflect.DeepEqual(gotLabels, test.wantLabels) { |
| 88 | t.Errorf("tick labels mismatch %d:\ngot: %q\nwant:%q", i, gotLabels, test.wantLabels) |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func valuesOf(ticks []Tick) []float64 { |
| 94 | var values []float64 |