test14.spec.js 595 B

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