test02.spec.js 558 B

1234567891011121314151617181920212223242526272829
  1. import {
  2. IVProgParser
  3. } from './../js/ast/ivprogParser';
  4. import { LanguageService } from './../js/services/languageService';
  5. describe('Legal newline syntax', () => {
  6. const input = `programa
  7. {
  8. const inteiro val = 5
  9. funcao p (
  10. inteiro a,
  11. inteiro b
  12. )
  13. {
  14. teste = a + b
  15. }
  16. }
  17. `;
  18. const lexer = LanguageService.getCurrentLexer();
  19. it(`should not result in SyntaxError`, () => {
  20. const as = new IVProgParser(input, lexer);
  21. const fun = as.parseTree.bind(as);
  22. expect(fun).not.toThrow();
  23. });
  24. });