test01.spec.js 496 B

12345678910111213141516171819202122
  1. import { IVProgParser } from './../js/ast/ivprogParser';
  2. import { LanguageService } from './../js/services/languageService';
  3. describe('Illegal newline syntax', () => {
  4. const input = `programa
  5. {
  6. const
  7. inteiro a = 1, b
  8. real
  9. PI = 5.6, c;
  10. }
  11. `;
  12. const lexer = LanguageService.getCurrentLexer();
  13. it(`should result in SyntaxError`, () => {
  14. const as = new IVProgParser(input, lexer);
  15. const fun = as.parseTree.bind(as);
  16. expect(fun).toThrow();
  17. });
  18. });