Adding specs for the basic repetitions
This commit is contained in:
parent
69ae3f0fe1
commit
8669d0c4bc
13
spec/parser/javascript/repeat_any_spec.js
Normal file
13
spec/parser/javascript/repeat_any_spec.js
Normal 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
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
13
spec/parser/javascript/repeat_optional_spec.js
Normal file
13
spec/parser/javascript/repeat_optional_spec.js
Normal 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
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
13
spec/parser/javascript/repeat_required_spec.js
Normal file
13
spec/parser/javascript/repeat_required_spec.js
Normal 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
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user