test11.spec.js 666 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. import { LanguageService } from '../js/services/languageService';
  9. describe('DoWhile command', () => {
  10. let input = `funcao inteiro test(real i) {
  11. inteiro a = 5 + i
  12. a = 5 + G[i][6]
  13. faca {
  14. a = a + 1
  15. } enquanto (a > 5)
  16. }`;
  17. const lexer = LanguageService.getCurrentLexer();
  18. it(`should not result in SyntaxError`, () => {
  19. const as = new IVProgParser(input, lexer);
  20. const fun = as.parseFunction.bind(as);
  21. expect(fun).not.toThrow();
  22. });
  23. });