test09.spec.js 581 B

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