1
0

test18.spec.js 766 B

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