1
// Singularity unit tests
2
@import "singularitygs";
4
@function test-round($n) {
5
// move decimal point three spaces
9
// move decimal point back
16
@if test-round(column-span(3, 2, 1 3 5 3.3 2, 1.2)) != 71.728% {
17
@debug "column-span failed with non-uniform columns";
18
@debug "column-span(3, 2, 1 3 5 3.3 2, 1.2) was #{column-span(3, 2, 1 3 5 3.3 2, 1.2)}";
19
@debug "should have been: 71.728%";
22
@if test-round(column-span(3, 2, 12, 1.2)) != 21.429% {
23
@debug "column-span failed with uniform columns";
24
@debug "column-span(3, 2, 12, 1.2) was #{column-span(3, 2, 12, 1.2)}";
25
@debug "should have been: 21.42857%";
30
@if column-sum(1 3 5 3.3 2, 1.2) != 19.1 {
31
@debug "column-sum failed with non-uniform columns";
32
@debug "column-sum(1 3 5 3.3 2, 1.2) was #{column-sum(1 3 5 3.3 2, 1.2)}";
33
@debug "should have been: 19.1";
36
@if column-sum(12, 1.2) != 25.2 {
37
@debug "column-sum failed with uniform columns";
38
@debug "column-sum(12, 1.2) was #{column-sum(12, 1.2)}";
39
@debug "should have been: 25.2";
44
@if column-count(1 3 5 3.3 2) != 5 {
45
@debug "column-count failed with non-uniform columns";
46
@debug "column-count(1 3 5 3.3 2) was #{column-count(1 3 5 3.3 2)}";
47
@debug "should have been: 5";
50
@if column-count(12) != 12 {
51
@debug "column-count failed with uniform columns";
52
@debug "column-count(12) was #{column-count(12)}";
53
@debug "should have been: 12";
58
@if context(37%, 83%) != 30.71 {
59
@debug "context failed";
60
@debug "context(37%, 83%) was #{context(37%, 83%)}";
61
@debug "should have been: 30.71";
66
@if test-round(gutter-span(1.2, 1 3 5 3.3 2)) != 6.283% {
67
@debug "gutter-span failed with non-uniform columns";
68
@debug "gutter-span(1.2, 1 3 5 3.3 2) was #{gutter-span(1.2, 1 3 5 3.3 2)}";
69
@debug "should have been: 6.283%";
72
@if test-round(gutter-span(1.2, 12)) != 4.762% {
73
@debug "gutter-span failed with uniform columns";
74
@debug "gutter-span(1.2, 12) was #{gutter-span(1.2, 12)}";
75
@debug "should have been: 4.762%";
b'\\ No newline at end of file'