aboutsummaryrefslogtreecommitdiffstats
path: root/test/_math.scss
diff options
context:
space:
mode:
Diffstat (limited to 'test/_math.scss')
-rw-r--r--test/_math.scss21
1 files changed, 21 insertions, 0 deletions
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 @@
1// sass-lint:disable empty-args
2
3@include describe('Math') {
4 @include it('iro-math-pow') {
5 @include assert-equal(iro-math-pow(2, 2), 2 * 2, '2^2');
6 @include assert-equal(iro-math-pow(2, 3), 2 * 2 * 2, '2^3');
7 @include assert-equal(iro-math-pow(4, 3), 4 * 4 * 4, '4^3');
8 @include assert-equal(iro-math-pow(3, -1), 1 / 3, '3^(-1)');
9 @include assert-equal(iro-math-pow(4, -2), 1 / (4 * 4), '4^(-2)');
10 @include assert-equal(iro-math-pow(3, 0), 1, '3^0');
11 }
12
13 @include it('iro-math-clamp') {
14 @include assert-equal(iro-math-clamp(0, 0, 10), 0, '0 in [0, 10]');
15 @include assert-equal(iro-math-clamp(10, 0, 10), 10, '10 in [0, 10]');
16 @include assert-equal(iro-math-clamp(20, 0, 10), 10, '20 in [0, 10]');
17 @include assert-equal(iro-math-clamp(3, 10, 20), 10, '3 in [10, 20]');
18 @include assert-equal(iro-math-clamp(-5, -30, -10), -10, '-5 in [-30, -10]');
19 @include assert-equal(iro-math-clamp(-5, -30, -2), -5, '-5 in [-30, -2]');
20 }
21}