test22.spec.js 753 B

123456789101112131415161718192021222324252627
  1. import Lexers from './../grammar/';
  2. import { IVProgParser } from './../js/ast/ivprogParser';
  3. import { IVProgProcessor} from './../js/processor/ivprogProcessor'
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('An assignment to a variable', function () {
  6. const input = `programa {
  7. funcao inicio() {
  8. inteiro a
  9. a = 5.5
  10. }
  11. }`;
  12. const lexer = LanguageService.getCurrentLexer();
  13. it(`should respect the variable type`, function (done) {
  14. const parser = new IVProgParser(input, lexer);
  15. const exec = new IVProgProcessor(parser.parseTree());
  16. exec.interpretAST().then(sto => {
  17. done(new Error('Should not have resolved'));
  18. }).catch( _ => {expect(1).toEqual(1);
  19. done();});
  20. });
  21. });