testDuplicateFunctions.spec.js 569 B

12345678910111213141516171819202122232425
  1. import { IVProgParser } from './../js/ast/ivprogParser';
  2. import { LanguageService } from '../js/services/languageService';
  3. describe('A code with a duplicate function', function () {
  4. let input = `programa {
  5. funcao inicio() {
  6. escreva(Matematica.tan(90))
  7. }
  8. funcao vazio inicio() {
  9. }
  10. }`;
  11. const lexer = LanguageService.getCurrentLexer();
  12. it(`should throw a syntax exception`, function () {
  13. const parser = new IVProgParser(input, lexer);
  14. const func = parser.parseTree;
  15. func.bind(parser);
  16. expect(func).toThrow();
  17. });
  18. });