test68.spec.js 850 B

12345678910111213141516171819202122232425262728
  1. import { IVProgParser } from './../js/ast/ivprogParser';
  2. import { IVProgProcessor} from './../js/processor/ivprogProcessor'
  3. import { SemanticAnalyser } from "./../js/processor/semantic/semanticAnalyser";
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('Tangent of 90° angles', function () {
  6. let input = `programa {
  7. funcao inicio() {
  8. escreva(Matematica.tangente(90))
  9. }
  10. }`;
  11. const lexer = LanguageService.getCurrentLexer();
  12. it(`should throw an exception`, function (done) {
  13. const parser = new IVProgParser(input, lexer);
  14. const semantic = new SemanticAnalyser(parser.parseTree());
  15. const exec = new IVProgProcessor(semantic.analyseTree());
  16. exec.interpretAST().then(_ => {
  17. done("No error thrown");
  18. }).catch( _ => {
  19. expect(1).toEqual(1);
  20. done();
  21. });
  22. });
  23. });