Update error handling tests.
This commit is contained in:
parent
c5d8f4510e
commit
302d409fab
@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1 +1 @@
|
||||
color_functions.mss:3:31 incorrect arguments given to hsl()
|
||||
color_functions.mss:3:31 incorrect arguments given to hsl()
|
@ -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
|
@ -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
|
@ -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)
|
@ -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()
|
@ -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?
|
@ -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.
|
1
test/errorhandling/issue119.result
Normal file
1
test/errorhandling/issue119.result
Normal file
@ -0,0 +1 @@
|
||||
issue119.mss:2:2 Map properties are not permitted in other rules
|
@ -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.
|
1
test/errorhandling/issue124.result
Normal file
1
test/errorhandling/issue124.result
Normal file
@ -0,0 +1 @@
|
||||
issue124.mss:6:0 missing closing `}`
|
@ -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.
|
1
test/errorhandling/issue_204_a.result
Normal file
1
test/errorhandling/issue_204_a.result
Normal file
@ -0,0 +1 @@
|
||||
issue_204_a.mss:3:1 missing opening `{`
|
1
test/errorhandling/issue_204_b.result
Normal file
1
test/errorhandling/issue_204_b.result
Normal file
@ -0,0 +1 @@
|
||||
issue_204_b.mss:3:3 missing opening `{`
|
1
test/errorhandling/issue_204_c.result
Normal file
1
test/errorhandling/issue_204_c.result
Normal file
@ -0,0 +1 @@
|
||||
issue_204_c.mss:4:0 missing opening `{`
|
1
test/errorhandling/issue_218.result
Normal file
1
test/errorhandling/issue_218.result
Normal file
@ -0,0 +1 @@
|
||||
issue_218.mss:5:2 missing opening `{`
|
@ -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
|
@ -1 +1 @@
|
||||
missing_close.mss:1:5 Missing closing ] of filter.
|
||||
missing_close.mss:1:5 Missing closing ] of filter.
|
1
test/errorhandling/multi_stylesheets.result
Normal file
1
test/errorhandling/multi_stylesheets.result
Normal file
@ -0,0 +1 @@
|
||||
multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity?
|
1
test/errorhandling/multi_stylesheets_b.result
Normal file
1
test/errorhandling/multi_stylesheets_b.result
Normal file
@ -0,0 +1 @@
|
||||
multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity?
|
1
test/errorhandling/nopound.result
Normal file
1
test/errorhandling/nopound.result
Normal file
@ -0,0 +1 @@
|
||||
nopound.mss:1:0 Invalid code: world {
|
1
test/errorhandling/notenoughargs.result
Normal file
1
test/errorhandling/notenoughargs.result
Normal file
@ -0,0 +1 @@
|
||||
notenoughargs.mss:3:31 incorrect number of arguments for darken(). 2 expected.
|
@ -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
|
@ -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.
|
@ -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.
|
Loading…
Reference in New Issue
Block a user