test18.spec.js 681 B

12345678910111213141516171819202122232425262728
  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. describe('Call to a function that receives no parameter', () => {
  9. let input = `programa {
  10. funcao inicio() {
  11. inteiro a
  12. fun()
  13. }
  14. funcao fun() {
  15. retorne
  16. }
  17. }`;
  18. const lexer = Lexers['pt_br'];
  19. it(`should not throw an Error`, () => {
  20. const as = new IVProgParser(input, lexer);
  21. const fun = as.parseTree.bind(as);
  22. expect(fun).not.toThrow();
  23. });
  24. });