Beginning to add some functionality to the parser

This commit is contained in:
Jeff Avallone
2014-11-26 18:24:40 -05:00
parent c6f2271867
commit facb99e8bc
6 changed files with 70 additions and 7 deletions
+23 -2
View File
@@ -1,7 +1,28 @@
import parser from 'src/js/parser/javascript.peg';
import parser from 'src/js/parser/javascript.js';
describe('parser/javascript.peg', function() {
pending();
describe('regular expression literals', function() {
describe('flags support', function() {
it('handles the ignore case flag', function() {
expect(parser.parse('/test/i').flags().ignore_case).toEqual(true);
expect(parser.parse('/test/').flags().ignore_case).toEqual(false);
});
it('handles the global flag', function() {
expect(parser.parse('/test/g').flags().global).toEqual(true);
expect(parser.parse('/test/').flags().global).toEqual(false);
});
it('handles the multiline flag', function() {
expect(parser.parse('/test/m').flags().multiline).toEqual(true);
expect(parser.parse('/test/').flags().multiline).toEqual(false);
});
});
});
});