|
8 | 8 | * to fail due to Java stack overflow. This must be run separate from other tests. |
9 | 9 | */ |
10 | 10 |
|
11 | | -/* jshint loopfunc:true */ |
12 | | - |
13 | 11 | (function(){ |
14 | 12 | "use strict"; |
15 | 13 | var Assert = YUITest.Assert, |
|
18 | 16 | len = rules.length, |
19 | 17 | i; |
20 | 18 |
|
21 | | - for (i=0; i < len; i++){ |
22 | | - |
23 | | - (function(i, rules){ |
| 19 | + function testAll(i, rules){ |
24 | 20 |
|
25 | | - suite.add(new YUITest.TestCase({ |
| 21 | + suite.add(new YUITest.TestCase({ |
26 | 22 |
|
27 | | - name: "General Tests for " + rules[i].id, |
| 23 | + name: "General Tests for " + rules[i].id, |
28 | 24 |
|
29 | | - setUp: function(){ |
30 | | - this.options = {}; |
31 | | - this.options[rules[i].id] = 1; |
32 | | - }, |
| 25 | + setUp: function(){ |
| 26 | + this.options = {}; |
| 27 | + this.options[rules[i].id] = 1; |
| 28 | + }, |
33 | 29 |
|
34 | | - "Using @viewport should not result in an error": function(){ |
35 | | - var result = CSSLint.verify("@viewport { width: auto; }", this.options); |
36 | | - Assert.areEqual(0, result.messages.length); |
37 | | - }, |
| 30 | + "Using @viewport should not result in an error": function(){ |
| 31 | + var result = CSSLint.verify("@viewport { width: auto; }", this.options); |
| 32 | + Assert.areEqual(0, result.messages.length); |
| 33 | + }, |
38 | 34 |
|
39 | | - "Using @keyframes should not result in an error": function(){ |
40 | | - var result = CSSLint.verify("@keyframes resize { 0% {padding: 0;} 50% {padding: 0;} 100% {padding: 0;}}", this.options); |
41 | | - Assert.areEqual(0, result.messages.length); |
42 | | - }, |
| 35 | + "Using @keyframes should not result in an error": function(){ |
| 36 | + var result = CSSLint.verify("@keyframes resize { 0% {padding: 0;} 50% {padding: 0;} 100% {padding: 0;}}", this.options); |
| 37 | + Assert.areEqual(0, result.messages.length); |
| 38 | + }, |
43 | 39 |
|
44 | | - "Using @page should not result in an error": function(){ |
45 | | - var result = CSSLint.verify("@page { width: 100px; }", this.options); |
46 | | - Assert.areEqual(0, result.messages.length); |
47 | | - }, |
| 40 | + "Using @page should not result in an error": function(){ |
| 41 | + var result = CSSLint.verify("@page { width: 100px; }", this.options); |
| 42 | + Assert.areEqual(0, result.messages.length); |
| 43 | + }, |
48 | 44 |
|
49 | | - "Using @page @top-left should not result in an error": function(){ |
50 | | - var result = CSSLint.verify("@page { @top-left { content: ''; } }", this.options); |
51 | | - Assert.areEqual(0, result.messages.length); |
52 | | - }, |
| 45 | + "Using @page @top-left should not result in an error": function(){ |
| 46 | + var result = CSSLint.verify("@page { @top-left { content: ''; } }", this.options); |
| 47 | + Assert.areEqual(0, result.messages.length); |
| 48 | + }, |
53 | 49 |
|
54 | | - "Using a regular rule should not result in an error": function(){ |
55 | | - var result = CSSLint.verify("body { margin: 0; }", this.options); |
56 | | - Assert.areEqual(0, result.messages.length); |
57 | | - } |
| 50 | + "Using a regular rule should not result in an error": function(){ |
| 51 | + var result = CSSLint.verify("body { margin: 0; }", this.options); |
| 52 | + Assert.areEqual(0, result.messages.length); |
| 53 | + } |
58 | 54 |
|
59 | | - })); |
| 55 | + })); |
60 | 56 |
|
61 | | - })(i, rules); |
| 57 | + } |
62 | 58 |
|
| 59 | + for (i = 0; i < len; i++){ |
| 60 | + testAll(i, rules); |
63 | 61 | } |
64 | 62 |
|
65 | 63 | YUITest.TestRunner.add(suite); |
|
0 commit comments