(t *testing.T)
| 1020 | } |
| 1021 | |
| 1022 | func TestThresholdTakesPrecedenceOverGradient(t *testing.T) { |
| 1023 | // Thresholds take precedence over SeriesColorGradient for matching points. |
| 1024 | withThreshold := PlotMany([][]float64{{1, 2, 3}}, |
| 1025 | SeriesColorGradient(Blue, Green), |
| 1026 | ColorAbove(Red, 2), |
| 1027 | ) |
| 1028 | if !strings.Contains(withThreshold, Red.String()) { |
| 1029 | t.Errorf("expected ColorAbove (Red) to override the gradient:\n%q", withThreshold) |
| 1030 | } |
| 1031 | gradientOnly := PlotMany([][]float64{{1, 2, 3}}, SeriesColorGradient(Blue, Green)) |
| 1032 | if withThreshold == gradientOnly { |
| 1033 | t.Errorf("threshold should change the output vs gradient-only:\n%q", withThreshold) |
| 1034 | } |
| 1035 | // ColorBelow overrides the gradient too. |
| 1036 | withBelow := PlotMany([][]float64{{1, 2, 3}}, |
| 1037 | SeriesColorGradient(Blue, Green), |
| 1038 | ColorBelow(Magenta, 2), |
| 1039 | ) |
| 1040 | if !strings.Contains(withBelow, Magenta.String()) { |
| 1041 | t.Errorf("expected ColorBelow (Magenta) to override the gradient:\n%q", withBelow) |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | func TestThresholdAcrossSeries(t *testing.T) { |
| 1046 | // One series sits entirely above the threshold, the other entirely below — |
nothing calls this directly
no test coverage detected
searching dependent graphs…