Commit b27386df by Nick Schonning

Switch sass-spec submodule for NPM

Closes #1709
parent 003819d3
[submodule "libsass"] [submodule "libsass"]
path = src/libsass path = src/libsass
url = git://github.com/sass/libsass.git url = git://github.com/sass/libsass.git
[submodule "test/sass-spec"]
path = test/fixtures/spec
url = https://github.com/sass/sass-spec.git
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
"mocha-lcov-reporter": "^1.2.0", "mocha-lcov-reporter": "^1.2.0",
"object-merge": "^2.5.1", "object-merge": "^2.5.1",
"read-yaml": "^1.0.0", "read-yaml": "^1.0.0",
"rimraf": "^2.5.2" "rimraf": "^2.5.2",
"sass-spec": "^3.3.6-3"
} }
} }
Subproject commit d70a0b3a34a8794b2b64baaec18f5949cf1777b9
...@@ -9,6 +9,7 @@ var assert = require('assert'), ...@@ -9,6 +9,7 @@ var assert = require('assert'),
readYaml = require('read-yaml'), readYaml = require('read-yaml'),
objectMerge = require('object-merge'), objectMerge = require('object-merge'),
glob = require('glob'), glob = require('glob'),
specPath = require('sass-spec').dirname.replace(/\\/g, '/'),
impl = 'libsass', impl = 'libsass',
version = 3.4; version = 3.4;
...@@ -17,7 +18,6 @@ var normalize = function(str) { ...@@ -17,7 +18,6 @@ var normalize = function(str) {
return str.replace(/\s+/g, ''); return str.replace(/\s+/g, '');
}; };
var specPath = join(__dirname, 'fixtures/spec/spec').replace(/\\/g, '/');
var inputs = glob.sync(specPath + '/**/input.*'); var inputs = glob.sync(specPath + '/**/input.*');
var initialize = function(inputCss, options) { var initialize = function(inputCss, options) {
......
var fs = require('fs'),
join = require('path').join,
spec = join(__dirname, '..', 'fixtures', 'spec', 'spec');
/**
* Normalize CSS
*
* @param {String} css
* @api public
*/
module.exports.normalize = function(str) {
return str.replace(/\s+/g, '').replace('{', '{\n').replace(';', ';\n');
};
/**
* Get test suites
*
* @api public
*/
module.exports.getSuites = function() {
var ret = {};
var suites = fs.readdirSync(spec);
var ignoreSuites = [
'libsass-todo-issues',
'libsass-todo-tests'
];
suites.forEach(function(suite) {
if (ignoreSuites.indexOf(suite) !== -1) {
return;
}
var suitePath = join(spec, suite);
var tests = fs.readdirSync(suitePath);
ret[suite] = {};
tests.forEach(function(test) {
var testPath = join(suitePath, test);
var hasErrorFile = fs.existsSync(join(testPath, 'error')) && !fs.statSync(join(testPath, 'error')).isDirectory();
var hasError = false;
if (hasErrorFile) {
var errorFileContents = fs.readFileSync(join(testPath, 'error')).toString();
hasError = !(
errorFileContents.match(/^DEPRECATION WARNING/) ||
errorFileContents.match(/^WARNING:/) ||
errorFileContents.match(/^.*?\/input.scss:\d+ DEBUG:/)
);
}
ret[suite][test] = {};
ret[suite][test].src = join(testPath, 'input.scss');
ret[suite][test].error = hasErrorFile && hasError;
ret[suite][test].expected = join(testPath, 'expected_output.css');
ret[suite][test].paths = [
testPath,
join(testPath, 'sub')
];
});
});
return ret;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment