mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 08:58:32 +02:00
Add new (more performant) matrix impl and initial work on tests.
This commit is contained in:
parent
b484dff945
commit
2e9a5f0a36
2 changed files with 102 additions and 0 deletions
|
@ -81,5 +81,23 @@
|
|||
(t/is (= 4 (gpt/quadrant p4)))))
|
||||
|
||||
|
||||
(t/deftest matrix-constructors-test
|
||||
(let [m (gmt/matrix)]
|
||||
(t/is (= @m [1 0 0 1 0 0]))
|
||||
(t/is (gmt/matrix? m)))
|
||||
(let [m (gmt/matrix 1 1 1 2 2 2)]
|
||||
(t/is (= @m [1 1 1 2 2 2]))
|
||||
(t/is (gmt/matrix? m)))
|
||||
(let [m (gmt/matrix [1 1 1 2 2 2])]
|
||||
(t/is (= @m [1 1 1 2 2 2]))
|
||||
(t/is (gmt/matrix? m))))
|
||||
|
||||
(t/deftest matrix-rotate-test
|
||||
(let [m (-> (gmt/matrix)
|
||||
(gmt/rotate 10))]
|
||||
|
||||
(t/is (= @m [0.984807753012208
|
||||
-0.17364817766693033
|
||||
0.17364817766693033
|
||||
0.984807753012208
|
||||
0 0]))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue