Skip to content

Commit ebff12d

Browse files
committed
Integral test
1 parent d785340 commit ebff12d

File tree

3 files changed

+89
-5
lines changed

3 files changed

+89
-5
lines changed

test/integral.expect.css

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/* Фигурные скобки. Вариант 1 */
2+
a, b, i /* foobar */
3+
{
4+
padding: 0;
5+
margin: 0;
6+
}
7+
div p
8+
{
9+
font-size: 1px;
10+
top: 0;
11+
}
12+
div p em
13+
{
14+
font-style: italic;
15+
border-bottom: 1px solid red;
16+
}
17+
18+
/* Фигурные скобки. Вариант 2 */
19+
div
20+
{
21+
padding: 0;
22+
margin: 0;
23+
}
24+
div p
25+
{
26+
font-size: 1px;
27+
top: 0;
28+
}
29+
div p em
30+
{
31+
font-style: italic;/* inline comment*/
32+
border-bottom: 1px solid red;
33+
}
34+
35+
/* Фигурные скобки. Вариант 3 */
36+
div
37+
{
38+
padding: 0;
39+
margin: 0;
40+
}
41+
/* foo */ div p
42+
{
43+
font-size: 1px;
44+
top: 0
45+
}
46+
div p em
47+
{
48+
/* upline comment*/
49+
font-style: italic;
50+
border-bottom: 1px solid red
51+
}
52+
53+
a
54+
{
55+
top: 0;/* ololo */margin: 0;}
56+
b
57+
{
58+
top: 0/* trololo */;margin: 0}

test/integral.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
var Comb = require('../lib/csscomb');
2+
var assert = require('assert');
3+
var vow = require('vow');
4+
var vfs = require('vow-fs');
5+
6+
describe('integral test', function() {
7+
var comb;
8+
it('Process result must be equal to expect.css', function() {
9+
comb = new Comb();
10+
comb.configure(require('../.csscomb.json'));
11+
vow.all(['origin', 'expect'].map(function(type) {
12+
var fileName = './test/integral.' + type + '.css';
13+
return vfs.read(fileName, 'utf8').then(function(data) {
14+
return data;
15+
});
16+
}))
17+
.then(function(results) {
18+
try {
19+
assert.equal(comb.processString(results[0]), results[1]);
20+
done();
21+
} catch (e) {
22+
done(e);
23+
}
24+
});
25+
});
26+
});

test/test.css renamed to test/integral.origin.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Фигурные скобки. Вариант 1 */
2-
div{
2+
a, b, i /* foobar */ {
33
padding:0;
44
margin:0;
55
}
@@ -34,21 +34,21 @@ div {
3434
padding:0;
3535
margin:0;
3636
}
37-
div p {
37+
/* foo */ div p {
3838
font-size:1px;
39-
top:0;
39+
top:0
4040
}
4141
div p em {
4242
/* upline comment*/
4343
font-style:italic;
44-
border-bottom:1px solid red;
44+
border-bottom:1px solid red
4545
}
4646

4747
a{
4848
top: 0;/* ololo */margin :0;}
4949
b
5050
{
51-
top :0/* trololo */;margin : 0;}
51+
top :0/* trololo */;margin : 0}
5252

5353

5454

0 commit comments

Comments
 (0)