(import svgpath) (unless (equal? '((M 100 200) (L 200 100) (L -100 -200)) (->apath "M100 200L200 100-100-200")) (error "(->apath \"M100 200L200 100-100-200\")")) (unless (equal? '((m 100 200) (l 100 -100) (l -300 -300)) (->rpath "M100 200L200 100-100-200")) (error "(->rpath \"M100 200L200 100-100-200\")")) (unless (equal? '((M 100 200) (l 100 -100) (L -100 -200)) (->mpath "M100 200L200 100-100-200")) (error "(->mpath \"M100 200L200 100-100-200\")")) (unless (equal? '"M1000 1000L101 101l1 1" (path->string "M1000 1000 L101 101 102 102")) (error "(path->string \"M1000 1000 L101 101 102 102\")")) (unless (equal? '"M100 100l1 1-11 1" (path->string "M100 100 L101,101 90 102")) (error "(path->string \"M100 100 L101,101 90 102\")")) (unless (equal? '"M100 200l100-100-300-300z" (path->string '((M 100 200) (l (@ frotz) 100 -100) (L (@ (coord (x 13) (y 23))) -100 -200) (z (@))))) (error "(path->string (quote ((M 100 200) (l (@ frotz) 100 -100) (L (@ (coord (x 13) (y 23))) -100 -200) (z (@)))))")) (unless (equal? '(((M (@ (coords (x 100) (y 200)) (distance 5)) 100 200) (H (@ (coords (x 105) (y 200)) (distance 2426510315628411/17592186044416)) 105) (L (@ (coords (x 200) (y 100)) (distance 1865933107185285/4398046511104)) 200 100) (L (@ (coords (x -100) (y -200)) (distance 3933732386813731/8796093022208)) -100 -200)) ((M (@ (coords (x 100) (y 200)) (distance 621977702395095/4398046511104)) 100 200) (l (@ (coords (x 200) (y 100)) (distance 1865933107185285/4398046511104)) 100 -100) (l (@ (coords (x -100) (y -200)) (distance 3933732386813731/8796093022208)) -300 -300)) ((M (@ (coords (x 100) (y 200)) (distance 621977702395095/4398046511104)) 100 200) (l (@ (coords (x 200) (y 100)) (distance 1865933107185285/4398046511104)) 100 -100) (L (@ (coords (x -100) (y -200)) (distance 3933732386813731/8796093022208)) -100 -200))) (map add-distances (list (->apath "M100 200h5L200 100-100-200") (->rpath "M100 200L200 100-100-200") (->mpath "M100 200L200 100-100-200")))) (error "(map add-distances (list (->apath \"M100 200h5L200 100-100-200\") (->rpath \"M100 200L200 100-100-200\") (->mpath \"M100 200L200 100-100-200\")))")) (unless (equal? '((M (@ (coords (x 100) (y 200))) (@ (coords (x 100) (y 200))) 100 200) (h (@ (coords (x 105) (y 200))) (@ (coords (x 105) (y 200))) 5) (L (@ (coords (x 200) (y 100))) (@ (coords (x 200) (y 100))) 200 100) (L (@ (coords (x -100) (y -200))) (@ (coords (x -100) (y -200))) -100 -200)) (add-coords (add-coords "M100 200h5L200 100-100-200"))) (error "(add-coords (add-coords \"M100 200h5L200 100-100-200\"))")) (unless (equal? '("M100 200L200 100-100-200" "M100 200l100-100-300-300" "M100 200l100-100L-100-200") (map (o path->string add-distances) (list (->apath "M100 200L200 100-100-200") (->rpath "M100 200L200 100-100-200") (->mpath "M100 200L200 100-100-200")))) (error "(map (o path->string add-distances) (list (->apath \"M100 200L200 100-100-200\") (->rpath \"M100 200L200 100-100-200\") (->mpath \"M100 200L200 100-100-200\")))")) (unless (equal? '"M100 200l100-100-300-300z" (path->string (add-coords (->rpath "M100 200L200 100-100-200z")))) (error "(path->string (add-coords (->rpath \"M100 200L200 100-100-200z\")))"))