From f306c22306032a4aa4a510485dc40f4411bbcd53 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 5 May 2022 08:27:28 +0800 Subject: [PATCH] add test --- test/matrix/test_m_determinant.scad | 31 +++++++++++++++++++++++++++++ test/test_all.scad | 1 + 2 files changed, 32 insertions(+) create mode 100644 test/matrix/test_m_determinant.scad diff --git a/test/matrix/test_m_determinant.scad b/test/matrix/test_m_determinant.scad new file mode 100644 index 00000000..8995478a --- /dev/null +++ b/test/matrix/test_m_determinant.scad @@ -0,0 +1,31 @@ +use ; + +module test_m_scaling() { + echo("==== test_m_determinant ===="); + + assert( + m_determinant([ + [3, 8], + [4, 6] + ]) == -14 + ); + + assert( + m_determinant([ + [6, 1, 1], + [4, -2, 5], + [2, 8, 7] + ]) == -306 + ); + + assert( + m_determinant([ + [0, 4, 0, -3], + [1, 1, 5, 2], + [1, -2, 0, 6], + [3, 0, 0, 1] + ]) == -250 + ); +} + +test_m_determinant(); \ No newline at end of file diff --git a/test/test_all.scad b/test/test_all.scad index ff8983bc..c6c5b5bd 100644 --- a/test/test_all.scad +++ b/test/test_all.scad @@ -99,6 +99,7 @@ include ; // Matrix include ; include ; +include ; // Voronoi include ;