Jasmine: Convert rule reference matching tests
This commit is contained in:
parent
14c11b4dfc
commit
b06bd774f5
|
@ -91,6 +91,21 @@ describe("generated parser", function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("rule reference matching", function() {
|
||||
varyAll(function(options) {
|
||||
it("follows rule references", function() {
|
||||
var parser = PEG.buildParser([
|
||||
'start = static / dynamic',
|
||||
'static = "C" / "C++" / "Java" / "C#"',
|
||||
'dynamic = "Ruby" / "Python" / "JavaScript"'
|
||||
].join("\n"), options);
|
||||
|
||||
expect(parser).toParse("Java", "Java");
|
||||
expect(parser).toParse("Python", "Python");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("literal matching", function() {
|
||||
varyAll(function(options) {
|
||||
it("matches empty literal correctly", function() {
|
||||
|
|
|
@ -633,16 +633,6 @@ testWithVaryingTrackLineAndColumn("initializer", function(options) {
|
|||
parses(functionInSemanticNotParser, "a", ["a", ""]);
|
||||
});
|
||||
|
||||
testWithVaryingTrackLineAndColumn("rule references", function(options) {
|
||||
var parser = PEG.buildParser([
|
||||
'start = static / dynamic',
|
||||
'static = "C" / "C++" / "Java" / "C#"',
|
||||
'dynamic = "Ruby" / "Python" / "JavaScript"'
|
||||
].join("\n"), options);
|
||||
parses(parser, "Java", "Java");
|
||||
parses(parser, "Python", "Python");
|
||||
});
|
||||
|
||||
testWithVaryingTrackLineAndColumn("cache", function(options) {
|
||||
var grammar = [
|
||||
'{ var n = 0; }',
|
||||
|
|
Loading…
Reference in a new issue