mirror of
https://github.com/penpot/penpot.git
synced 2025-03-19 11:11:21 -05:00
🐛 Fix some broken tests
This commit is contained in:
parent
b9e3426532
commit
aecb8a1464
2 changed files with 17 additions and 7 deletions
|
@ -71,21 +71,31 @@
|
|||
|
||||
(t/deftest matrix-constructors-test
|
||||
(let [m (gmt/matrix)]
|
||||
(t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,0.0,0.0)")))
|
||||
(t/is (= 1.0 (.-a m)))
|
||||
(t/is (= 0.0 (.-b m)))
|
||||
(t/is (= 0.0 (.-c m)))
|
||||
(t/is (= 1.0 (.-d m)))
|
||||
(t/is (= 0.0 (.-e m)))
|
||||
(t/is (= 0.0 (.-f m))))
|
||||
(let [m (gmt/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/is (= 1.0 (.-a m)))
|
||||
(t/is (= 1.0 (.-b m)))
|
||||
(t/is (= 1.0 (.-c m)))
|
||||
(t/is (= 2.0 (.-d m)))
|
||||
(t/is (= 2.0 (.-e m)))
|
||||
(t/is (= 2.0 (.-f m)))))
|
||||
|
||||
(t/deftest matrix-translate-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/translate (gpt/point 2 10)))]
|
||||
(t/is (= (str m) "matrix(1.0,0.0,0.0,1.0,2.0,10.0)"))))
|
||||
(t/is (= m (gmt/matrix 1 0 0 1 2 10)))))
|
||||
|
||||
(t/deftest matrix-scale-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/scale (gpt/point 2)))]
|
||||
(t/is (= (str m) "matrix(2.0,0.0,0.0,2.0,0.0,0.0)"))))
|
||||
(t/is (= m (gmt/matrix 2 0 0 2 0 0)))))
|
||||
|
||||
(t/deftest matrix-rotate-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/rotate 10))]
|
||||
(t/is (= (str m) "matrix(0.984807753012208,0.17364817766693033,-0.17364817766693033,0.984807753012208,0.0,0.0)"))))
|
||||
(t/is (= m (gmt/matrix 0.984807753012208 0.17364817766693033 -0.17364817766693033 0.984807753012208 0 0)))))
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
:components {}
|
||||
:version 7}
|
||||
|
||||
res (cpm/migrate-data data)]
|
||||
res (cpm/migrate-data data nil 8)]
|
||||
|
||||
;; (pprint data)
|
||||
;; (pprint res)
|
||||
|
@ -81,7 +81,7 @@
|
|||
(let [id (uuid/custom 1 2)]
|
||||
(into [] (remove #(= id %)) shapes)))))
|
||||
|
||||
res (cpm/migrate-data data)]
|
||||
res (cpm/migrate-data data nil 8)]
|
||||
|
||||
;; (pprint res)
|
||||
;; (pprint expect)
|
||||
|
|
Loading…
Add table
Reference in a new issue