~ubuntu-branches/ubuntu/wily/compass-singularitygs-plugin/wily

« back to all changes in this revision

Viewing changes to example/sass/unit-tests.scss

  • Committer: Package Import Robot
  • Author(s): Jonas Smedegaard
  • Date: 2014-10-23 06:34:19 UTC
  • Revision ID: package-import@ubuntu.com-20141023063419-puyq1q4u952vqf19
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Singularity unit tests
 
2
@import "singularitygs";
 
3
 
 
4
@function test-round($n) {
 
5
  // move decimal point three spaces
 
6
  $n: $n * 1000;
 
7
  // round
 
8
  $n: round($n);
 
9
  // move decimal point back
 
10
  $n: $n / 1000;
 
11
 
 
12
  @return $n;
 
13
}
 
14
 
 
15
// column-span tests
 
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%";
 
20
  @debug "";
 
21
}
 
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%";
 
26
  @debug "";
 
27
}
 
28
 
 
29
// column-sum tests
 
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";
 
34
  @debug "";
 
35
}
 
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";
 
40
  @debug "";
 
41
}
 
42
 
 
43
// column-count tests
 
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";
 
48
  @debug "";
 
49
}
 
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";
 
54
  @debug "";
 
55
}
 
56
 
 
57
// context test
 
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";
 
62
  @debug "";
 
63
}
 
64
 
 
65
// gutter-span test
 
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%";
 
70
  @debug "";
 
71
}
 
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%";
 
76
  @debug "";
 
77
}
 
 
b'\\ No newline at end of file'