MCPcopy Create free account
hub / github.com/tdewolff/canvas / TestPathToPS

Function TestPathToPS

path_test.go:829–845  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

827}
828
829func TestPathToPS(t *testing.T) {
830 var tts = []struct {
831 p string
832 ps string
833 }{
834 {"", ""},
835 {"L10 0Q15 10 20 0M20 10C20 20 30 20 30 10z", "0 0 moveto 10 0 lineto 13.333333 6.6666667 16.666667 6.6666667 20 0 curveto 20 10 moveto 20 20 30 20 30 10 curveto closepath"},
836 {"L10 0M20 0L30 0", "0 0 moveto 10 0 lineto 20 0 moveto 30 0 lineto"},
837 {"A5 5 0 0 1 10 0", "0 0 moveto 5 0 5 5 180 360 0 ellipse"},
838 {"A10 5 90 0 0 10 0", "0 0 moveto 5 0 10 5 90 -90 90 ellipsen"},
839 }
840 for _, tt := range tts {
841 t.Run(tt.p, func(t *testing.T) {
842 test.T(t, MustParseSVGPath(tt.p).ToPS(), tt.ps)
843 })
844 }
845}
846
847func TestPathToPDF(t *testing.T) {
848 var tts = []struct {

Callers

nothing calls this directly

Calls 4

MustParseSVGPathFunction · 0.85
TMethod · 0.80
ToPSMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected