test11.spec.js 634 B

123456789101112131415161718192021222324
  1. import {
  2. IVProgParser
  3. } from './../js/ast/ivprogParser';
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('DoWhile command', () => {
  6. let input = `funcao inteiro test(real i) {
  7. inteiro a = 5 + i
  8. a = 5 + G[i][6]
  9. faca {
  10. a = a + 1
  11. } enquanto (a > 5)
  12. }`;
  13. const lexer = LanguageService.getCurrentLexer();
  14. it(`should not result in SyntaxError`, () => {
  15. const as = new IVProgParser(input, lexer);
  16. as.pushVariableStack();
  17. const fun = as.parseFunction.bind(as);
  18. expect(fun).not.toThrow();
  19. as.popVariableStack();
  20. });
  21. });