(t *testing.T)
| 96 | } |
| 97 | |
| 98 | func TestPathOffset(t *testing.T) { |
| 99 | tolerance := 0.01 |
| 100 | var tts = []struct { |
| 101 | orig string |
| 102 | w float64 |
| 103 | offset string |
| 104 | }{ |
| 105 | {"L10 0L10 10L0 10z", 0.0, "L10 0L10 10L0 10z"}, |
| 106 | //{"L10 0L10 10L0 10", 1.0, "M0 -1L10 -1A1 1 0 0 1 11 0L11 10A1 1 0 0 1 10 11L0 11"}, |
| 107 | //{"L10 0L10 10L0 10z", 1.0, "M10 -1A1 1 0 0 1 11 0L11 10A1 1 0 0 1 10 11L0 11A1 1 0 0 1 -1 10L-1 0A1 1 0 0 1 0 -1z"}, |
| 108 | {"L10 0L10 10L0 10z", -1.0, "M1 1L9 1L9 9L1 9z"}, |
| 109 | {"L10 0L5 0z", -1.0, ""}, |
| 110 | } |
| 111 | for _, tt := range tts { |
| 112 | t.Run(fmt.Sprintf("%v/%v", tt.orig, tt.w), func(t *testing.T) { |
| 113 | offset := MustParseSVGPath(tt.orig).Offset(tt.w, tolerance) |
| 114 | test.T(t, offset, MustParseSVGPath(tt.offset)) |
| 115 | }) |
| 116 | } |
| 117 | } |
nothing calls this directly
no test coverage detected