test22.spec.js 700 B

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