0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-15 19:48:22 -05:00

📎 Fix common tests.

This commit is contained in:
Andrey Antukh 2021-12-31 13:46:13 +01:00
parent 10e7d660ef
commit 261724e555
2 changed files with 7 additions and 8 deletions

View file

@ -181,11 +181,10 @@
shape-before (-> (create-test-shape type {:modifiers modifiers}) shape-before (-> (create-test-shape type {:modifiers modifiers})
(assoc :selrect selrect)) (assoc :selrect selrect))
shape-after (gsh/transform-shape shape-before {:round-coords? false})] shape-after (gsh/transform-shape shape-before {:round-coords? false})]
(= (:selrect shape-before) (= (:selrect shape-before)
(:selrect shape-after))) (:selrect shape-after)))
:rect {:x 0 :y 0 :x1 0 :y1 0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf} :rect {:x 0.0 :y 0.0 :x1 0.0 :y1 0.0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf}
:path {:x 0 :y 0 :x1 0 :y1 0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf} :path {:x 0.0 :y 0.0 :x1 0.0 :y1 0.0 :x2 ##Inf :y2 ##Inf :width ##Inf :height ##Inf}
:rect nil :rect nil
:path nil))) :path nil)))

View file

@ -71,21 +71,21 @@
(t/deftest matrix-constructors-test (t/deftest matrix-constructors-test
(let [m (gmt/matrix)] (let [m (gmt/matrix)]
(t/is (= (str m) "matrix(1,0,0,1,0,0)"))) (t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,0.0,0.0)")))
(let [m (gmt/matrix 1 1 1 2 2 2)] (let [m (gmt/matrix 1 1 1 2 2 2)]
(t/is (= (str m) "matrix(1,1,1,2,2,2)")))) (t/is (= (str m) "matrix(1.0,1.0,1.0,2.0,2.0,2.0)"))))
(t/deftest matrix-translate-test (t/deftest matrix-translate-test
(let [m (-> (gmt/matrix) (let [m (-> (gmt/matrix)
(gmt/translate (gpt/point 2 10)))] (gmt/translate (gpt/point 2 10)))]
(t/is (= (str m) "matrix(1,0,0,1,2,10)")))) (t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,2.0,10.0)"))))
(t/deftest matrix-scale-test (t/deftest matrix-scale-test
(let [m (-> (gmt/matrix) (let [m (-> (gmt/matrix)
(gmt/scale (gpt/point 2)))] (gmt/scale (gpt/point 2)))]
(t/is (= (str m) "matrix(2,0,0,2,0,0)")))) (t/is (= (str m) "matrix(2.0,0.0,0.0,2.0,0.0,0.0)"))))
(t/deftest matrix-rotate-test (t/deftest matrix-rotate-test
(let [m (-> (gmt/matrix) (let [m (-> (gmt/matrix)
(gmt/rotate 10))] (gmt/rotate 10))]
(t/is (= (str m) "matrix(0.984807753012208,0.17364817766693033,-0.17364817766693033,0.984807753012208,0,0)")))) (t/is (= (str m) "matrix(0.984807753012208,0.17364817766693033,-0.17364817766693033,0.984807753012208,0.0,0.0)"))))