test14.spec.js 622 B

1234567891011121314151617181920212223242526
  1. import Lexers from './../grammar/';
  2. import {
  3. IVProgParser
  4. } from './../js/ast/ivprogParser';
  5. import { LanguageService } from '../js/services/languageService';
  6. describe('For with no \';\'', () => {
  7. let input = `funcao inteiro test(real i) {
  8. inteiro a = 5 + i
  9. a = 5 + G[i][6]
  10. para (a = 0
  11. a < 5
  12. a = a + 1) {
  13. a = a
  14. }
  15. }`;
  16. const lexer = LanguageService.getCurrentLexer();
  17. it(`should result in SyntaxError`, () => {
  18. const as = new IVProgParser(input, lexer);
  19. const fun = as.parseFunction.bind(as);
  20. expect(fun).toThrow();
  21. });
  22. });