Update error handling tests.

This commit is contained in:
Young Hahn 2014-05-20 16:10:31 -04:00
parent c5d8f4510e
commit 302d409fab
25 changed files with 34 additions and 48 deletions

View File

@ -19,29 +19,17 @@ helper.files('errorhandling', 'mml', function(file) {
data_dir: path.join(__dirname, '../data'),
local_data_dir: path.join(__dirname, 'rendering'),
filename: file
}).render(mml, function (err) {
if (!err) {
throw new Error("*** invalid error handling test found: " + basename + ": all error handling tests should throw!");
}
var result = helper.resultFile(file);
var output = err.message;
// @TODO for some reason, fs.readFile includes an additional \n
// at the end of read files. Determine why.
fs.readFile(helper.resultFile(file), 'utf8', function(err, data) {
if (!err) assert.deepEqual(output, data.substr(0, data.length - 1));
done();
});
});
}).render(mml);
} catch(err) {
if (err.message.indexOf('***') > -1) throw err;
var result = helper.resultFile(file);
var output = err.message;
// @TODO for some reason, fs.readFile includes an additional \n
// at the end of read files. Determine why.
fs.readFile(helper.resultFile(file), 'utf8', function(err, data) {
if (!err) assert.deepEqual(output, data.substr(0, data.length - 1));
done();
});
// fs.writeFileSync(helper.resultFile(file), output);
var data = fs.readFileSync(helper.resultFile(file), 'utf8');
assert.deepEqual(output, data);
done();
}
});
});
@ -65,29 +53,17 @@ helper.files('errorhandling', 'mss', function(file) {
// note: we use the basename here so that the expected error result
// will match if the style was loaded from mml
filename: basename
}).renderMSS(mss, function (err) {
if (!err) {
throw new Error("*** invalid error handling test found: " + basename + ": all error handling tests should throw!");
}
var result = helper.resultFile(file);
var output = err.message;
// @TODO for some reason, fs.readFile includes an additional \n
// at the end of read files. Determine why.
fs.readFile(helper.resultFile(file), 'utf8', function(err, data) {
if (!err) assert.deepEqual(output, data.substr(0, data.length - 1));
done();
});
});
}).renderMSS(mss);
} catch(err) {
if (err.message.indexOf('***') > -1) throw err;
var result = helper.resultFile(file);
var output = err.message;
// @TODO for some reason, fs.readFile includes an additional \n
// at the end of read files. Determine why.
fs.readFile(helper.resultFile(file), 'utf8', function(err, data) {
if (!err) assert.deepEqual(output, data.substr(0, data.length - 1));
done();
});
// fs.writeFileSync(helper.resultFile(file), output);
var data = fs.readFileSync(helper.resultFile(file), 'utf8');
assert.deepEqual(output, data);
done();
}
});
});

View File

@ -1 +1 @@
color_functions.mss:3:31 incorrect arguments given to hsl()
color_functions.mss:3:31 incorrect arguments given to hsl()

View File

@ -1 +1 @@
contradiction.mss:1:37 [[FeatureCla]=] added to [FeatureCla]!= produces an invalid filter
contradiction.mss:1:37 [[FeatureCla]=] added to [FeatureCla]!= produces an invalid filter

View File

@ -1 +1 @@
contradiction_2.mss:1:37 [[FeatureCla]!=] added to [FeatureCla]= produces an invalid filter
contradiction_2.mss:1:37 [[FeatureCla]!=] added to [FeatureCla]= produces an invalid filter

View File

@ -1 +1 @@
function_args.mss:3:38 unknown function agg-stack-blu(), did you mean agg-stack-blur(2)
function_args.mss:3:38 unknown function agg-stack-blu(), did you mean agg-stack-blur(2)

View File

@ -1 +1 @@
invalid_color_in_fn.mss:2:34 incorrect arguments given to spin()
invalid_color_in_fn.mss:2:34 incorrect arguments given to spin()

View File

@ -1 +1 @@
invalid_property.mss:3:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity?
invalid_property.mss:3:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity?

View File

@ -1,2 +1,2 @@
invalid_value.mss:2:2 Invalid value for text-face-name, the type font is expected. 2 (of type float) was given.
invalid_value.mss:3:2 Invalid value for line-rasterizer, the type keyword (options: full, fast) is expected. full (of type string) was given.
invalid_value.mss:3:2 Invalid value for line-rasterizer, the type keyword (options: full, fast) is expected. full (of type string) was given.

View File

@ -0,0 +1 @@
issue119.mss:2:2 Map properties are not permitted in other rules

View File

@ -1 +1 @@
issue123.mss:3:31 incorrect number of arguments for darken(). 2 expected.
issue123.mss:3:31 incorrect number of arguments for darken(). 2 expected.

View File

@ -0,0 +1 @@
issue124.mss:6:0 missing closing `}`

View File

@ -1 +1 @@
issue297.mss:2:2 Invalid value for text-name, the type expression is expected. invalid (of type keyword) was given.
issue297.mss:2:2 Invalid value for text-name, the type expression is expected. invalid (of type keyword) was given.

View File

@ -0,0 +1 @@
issue_204_a.mss:3:1 missing opening `{`

View File

@ -0,0 +1 @@
issue_204_b.mss:3:3 missing opening `{`

View File

@ -0,0 +1 @@
issue_204_c.mss:4:0 missing opening `{`

View File

@ -0,0 +1 @@
issue_218.mss:5:2 missing opening `{`

View File

@ -1 +1 @@
mapnik_keyword.mss:1:6 nul is not a valid keyword in a filter expression
mapnik_keyword.mss:1:6 nul is not a valid keyword in a filter expression

View File

@ -1 +1 @@
missing_close.mss:1:5 Missing closing ] of filter.
missing_close.mss:1:5 Missing closing ] of filter.

View File

@ -0,0 +1 @@
multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity?

View File

@ -0,0 +1 @@
multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity?

View File

@ -0,0 +1 @@
nopound.mss:1:0 Invalid code: world {

View File

@ -0,0 +1 @@
notenoughargs.mss:3:31 incorrect number of arguments for darken(). 2 expected.

View File

@ -1,3 +1,3 @@
undefined_variable.mss:2:16 variable @something is undefined
undefined_variable.mss:3:14 variable @something is undefined
undefined_variable.mss:4:22 variable @something is undefined
undefined_variable.mss:4:22 variable @something is undefined

View File

@ -1 +1 @@
zoom_as_var.mss:2:2 Cannot do math with type keyword.
zoom_as_var.mss:2:2 Cannot do math with type keyword.

View File

@ -1 +1 @@
zoommax.mss:1:6 Only zoom levels between 0 and 22 supported.
zoommax.mss:1:6 Only zoom levels between 0 and 22 supported.