test06.spec.js 574 B

123456789101112131415161718192021222324
  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('While command', () => {
  9. let input = `funcao inteiro test(real i) {
  10. inteiro a = 5 + i
  11. a = 5 + G[i][6]
  12. enquanto (a > 5) {
  13. a = a + 1
  14. }
  15. }`;
  16. const lexer = Lexers['pt_br'];
  17. it(`should not result in SyntaxError`, () => {
  18. const as = new IVProgParser(input, lexer);
  19. const fun = as.parseFunction.bind(as);
  20. expect(fun).not.toThrow();
  21. });
  22. });