test18.spec.js 581 B

1234567891011121314151617181920212223242526
  1. import {
  2. IVProgParser
  3. } from './../js/ast/ivprogParser';
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('Call to a function that receives no parameter', () => {
  6. let input = `programa {
  7. funcao inicio() {
  8. inteiro a
  9. fun()
  10. }
  11. funcao fun() {
  12. retorne
  13. }
  14. }`;
  15. const lexer = LanguageService.getCurrentLexer();
  16. it(`should not throw an Error`, () => {
  17. const as = new IVProgParser(input, lexer);
  18. const fun = as.parseTree.bind(as);
  19. expect(fun).not.toThrow();
  20. });
  21. });