Adding nested classes test and fixed specificity test runner
This commit is contained in:
parent
86e79b9b2c
commit
f6b5f5785a
@ -26,17 +26,15 @@ function cleanupItem(key, value) {
|
||||
helper.files('specificity', 'mss', function(file) {
|
||||
exports['test ' + file] = function(beforeExit) {
|
||||
helper.file(file, function(content) {
|
||||
new carto.Parser({
|
||||
var tree = (new carto.Parser({
|
||||
paths: [ path.dirname(file) ],
|
||||
filename: file
|
||||
}).parse(content, function (err, tree) {
|
||||
if (err) throw err;
|
||||
})).parse(content);
|
||||
|
||||
var mss = tree.toList({});
|
||||
mss = helper.makePlain(mss, cleanupItem);
|
||||
var mss = tree.toList({});
|
||||
mss = helper.makePlain(mss, cleanupItem);
|
||||
|
||||
helper.compareToFile(mss, file, helper.resultFile(file));
|
||||
});
|
||||
helper.compareToFile(mss, file, helper.resultFile(file));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
8
test/specificity/nestedclasses.mss
Normal file
8
test/specificity/nestedclasses.mss
Normal file
@ -0,0 +1,8 @@
|
||||
.strikes {
|
||||
marker-width:1;
|
||||
.fill { marker-opacity:1; }
|
||||
&.outline { marker-line-opacity:1; }
|
||||
[ISO = "USA"] {
|
||||
marker-line-opacity:0.4;
|
||||
}
|
||||
}
|
3
test/specificity/nestedclasses.result
Normal file
3
test/specificity/nestedclasses.result
Normal file
@ -0,0 +1,3 @@
|
||||
[
|
||||
{"elements":[".strikes"],"specificity":[0,1,0,13]}
|
||||
]
|
Loading…
Reference in New Issue
Block a user