test22.spec.js 716 B

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