You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
515 B
JavaScript
21 lines
515 B
JavaScript
/* global peg */
|
|
|
|
"use strict";
|
|
|
|
describe("compiler pass |reportDuplicateRules|", function() {
|
|
var pass = peg.compiler.passes.check.reportDuplicateRules;
|
|
|
|
it("reports duplicate rules", function() {
|
|
expect(pass).toReportError([
|
|
'start = "a"',
|
|
'start = "b"'
|
|
].join('\n'), {
|
|
message: 'Rule "start" is already defined at line 1, column 1.',
|
|
location: {
|
|
start: { offset: 12, line: 2, column: 1 },
|
|
end: { offset: 23, line: 2, column: 12 }
|
|
}
|
|
});
|
|
});
|
|
});
|