pegjs/test/spec/unit/compiler/passes/report-duplicate-rules.spec.js
Futago-za Ryuu be88239543 Move PEG.js to packages/pegjs
* Move PEG.js from . to packages/pegjs
* Update relevanr paths
* Remove pegjs-dev; Use pegjs directly
* Generate browser files at packages/pegjs/dist
* nyc: exclude website
* website: keep packages folder
* Root package.json is private now
2018-09-08 02:39:12 +01:00

29 lines
712 B
JavaScript

"use strict";
const chai = require( "chai" );
const helpers = require( "./helpers" );
const pass = require( "pegjs" ).compiler.passes.check.reportDuplicateRules;
chai.use( helpers );
const expect = chai.expect;
describe( "compiler pass |reportDuplicateRules|", function () {
it( "reports duplicate rules", function () {
expect( pass ).to.reportError( [
"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 }
}
} );
} );
} );