Skip to content

Commit cdb47a2

Browse files
committed
add some tests
1 parent c6a409e commit cdb47a2

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

test/functions/_cos.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@include describe("Cos") {
22
@include it("should calculate the cosine of a number") {
3-
@include should(expect( cos(0.7854) ), to( be-close-to( 0.70711, 5 )));
4-
@include should(expect( cos(45deg) ), to( be-close-to( 0.70711, 5 )));
3+
@include should(expect( cos(0.7854) ), to( be-close-to( 0.70711, 5 )));
4+
@include should(expect( cos(45deg) ), to( be-close-to( 0.70711, 5 )));
5+
@include should(expect( cos(315deg) ), to( be-close-to( 0.70711, 5 )));
6+
@include should(expect( cos(3645deg) ), to( be-close-to( 0.70711, 5 )));
7+
@include should(expect( cos(-3645deg) ), to( be-close-to( 0.70711, 5 )));
58
}
69
}

test/functions/_log.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@
44
@include should(expect( log(10) ), to( be-close-to( 2.30259, 5 )));
55
@include should(expect( log(2, 10) ), to( be-close-to( 0.30103, 5 )));
66
}
7+
8+
@include it("should calculate the natural logarithm of a large fractional number") {
9+
@include should(expect( log(12345.678) ), to( be-close-to( 9.421061, 5 )));
10+
}
11+
12+
@include it("should calculate the natural logarithm of a small fractional number") {
13+
@include should(expect( log(0.0001) ), to( be-close-to( -9.210340, 5 )));
14+
}
715
}

test/functions/_sqrt.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
@include it("should calculate square roots") {
33
@include should(expect( sqrt(2) ), to( be-close-to( 1.41421, 5 )));
44
@include should(expect( sqrt(5) ), to( be-close-to( 2.23607, 5 )));
5+
@include should(expect( sqrt(12345.67) ), to( be-close-to( 111.11107, 5 )));
56
}
67
}

0 commit comments

Comments
 (0)