Adding specs for the basic repetitions

This commit is contained in:
Jeff Avallone 2014-12-19 20:53:15 -05:00
parent 69ae3f0fe1
commit 8669d0c4bc
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,13 @@
import javascript from 'src/js/parser/javascript/parser.js';
describe('parser/javascript/repeat_any.js', function() {
it('parses "*" as a RepeatAny', function() {
var parser = new javascript.Parser('*');
expect(parser.__consume__repeat_any()).toEqual(jasmine.objectContaining({
minimum: 0,
maximum: -1
}));
});
});

View File

@ -0,0 +1,13 @@
import javascript from 'src/js/parser/javascript/parser.js';
describe('parser/javascript/repeat_optional.js', function() {
it('parses "?" as a RepeatOptional', function() {
var parser = new javascript.Parser('?');
expect(parser.__consume__repeat_optional()).toEqual(jasmine.objectContaining({
minimum: 0,
maximum: 1
}));
});
});

View File

@ -0,0 +1,13 @@
import javascript from 'src/js/parser/javascript/parser.js';
describe('parser/javascript/repeat_any.js', function() {
it('parses "+" as a RepeatRequired', function() {
var parser = new javascript.Parser('+');
expect(parser.__consume__repeat_required()).toEqual(jasmine.objectContaining({
minimum: 1,
maximum: -1
}));
});
});