test07.spec.js 609 B

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