From d07f664450ddaaebb44127a4bd057763d13d3f82 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Sun, 1 Nov 2020 20:55:14 +0100 Subject: Init --- test/_math.scss | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/_math.scss (limited to 'test/_math.scss') diff --git a/test/_math.scss b/test/_math.scss new file mode 100644 index 0000000..5f40499 --- /dev/null +++ b/test/_math.scss @@ -0,0 +1,21 @@ +// sass-lint:disable empty-args + +@include describe('Math') { + @include it('iro-math-pow') { + @include assert-equal(iro-math-pow(2, 2), 2 * 2, '2^2'); + @include assert-equal(iro-math-pow(2, 3), 2 * 2 * 2, '2^3'); + @include assert-equal(iro-math-pow(4, 3), 4 * 4 * 4, '4^3'); + @include assert-equal(iro-math-pow(3, -1), 1 / 3, '3^(-1)'); + @include assert-equal(iro-math-pow(4, -2), 1 / (4 * 4), '4^(-2)'); + @include assert-equal(iro-math-pow(3, 0), 1, '3^0'); + } + + @include it('iro-math-clamp') { + @include assert-equal(iro-math-clamp(0, 0, 10), 0, '0 in [0, 10]'); + @include assert-equal(iro-math-clamp(10, 0, 10), 10, '10 in [0, 10]'); + @include assert-equal(iro-math-clamp(20, 0, 10), 10, '20 in [0, 10]'); + @include assert-equal(iro-math-clamp(3, 10, 20), 10, '3 in [10, 20]'); + @include assert-equal(iro-math-clamp(-5, -30, -10), -10, '-5 in [-30, -10]'); + @include assert-equal(iro-math-clamp(-5, -30, -2), -5, '-5 in [-30, -2]'); + } +} -- cgit v1.2.3-70-g09d2