test09.spec.js 617 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('Break command outside a loop', () => {
  7. let input = `funcao inteiro test(real i) {
  8. inteiro a = 5 + i
  9. a = 5 + G[i][6]
  10. enquanto (a > 5) {
  11. a = a + 1
  12. }
  13. pare
  14. }`;
  15. const lexer = LanguageService.getCurrentLexer();
  16. it(`should result in SyntaxError`, () => {
  17. const as = new IVProgParser(input, lexer);
  18. const fun = as.parseFunction.bind(as);
  19. expect(fun).toThrow();
  20. });
  21. });