(w vg.Length)
| 86 | } |
| 87 | |
| 88 | func lines(w vg.Length) (*plot.Plot, error) { |
| 89 | p := plot.New() |
| 90 | pts := plotter.XYs{ |
| 91 | {X: 0, Y: 0}, {X: 0, Y: 1}, |
| 92 | {X: 1, Y: 0}, {X: 1, Y: 1}, |
| 93 | } |
| 94 | line, err := plotter.NewLine(pts) |
| 95 | if err != nil { |
| 96 | return nil, err |
| 97 | } |
| 98 | line.Width = w |
| 99 | p.Add(line) |
| 100 | p.X.Label.Text = "X label" |
| 101 | p.Y.Label.Text = "Y label" |
| 102 | |
| 103 | return p, nil |
| 104 | } |
| 105 | |
| 106 | func TestParseLength(t *testing.T) { |
| 107 | for _, table := range []struct { |
no test coverage detected