(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestPathDataTruncated(t *testing.T) { |
| 93 | var pathDataTests = []struct { |
| 94 | pathData string |
| 95 | expected string |
| 96 | }{ |
| 97 | {"m100 0 50 50zM100 0z", "m1e2.0 50 50zm0 0z"}, |
| 98 | {"M194.4 16.4C194.4 7.4 187 0 177.9 0 168.8 0 161.5 7.4 161.5 16.4", "M194 16.4C194 7.4 187 0 178 0S162 7.4 162 16.4"}, // #233 |
| 99 | //{"M100 100L200.4 200.4l100.2 100.2", "M100 100L200 200L301 301"}, // remember rounding error |
| 100 | //{"M100 100L200.4 200.4L300.6 300.6", "M100 100L200 200L301 301"}, |
| 101 | } |
| 102 | |
| 103 | p := NewPathData(&Minifier{Precision: 3}) |
| 104 | for _, tt := range pathDataTests { |
| 105 | t.Run(tt.pathData, func(t *testing.T) { |
| 106 | path := p.ShortenPathData([]byte(tt.pathData)) |
| 107 | test.Minify(t, tt.pathData, nil, string(path), tt.expected) |
| 108 | }) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | //////////////////////////////////////////////////////////////// |
| 113 |
nothing calls this directly
no test coverage detected
searching dependent graphs…