test22.spec.js 639 B

123456789101112131415161718192021222324
  1. import Lexers from './../grammar/';
  2. import { IVProgParser } from './../js/ast/ivprogParser';
  3. import { IVProgProcessor} from './../js/processor/ivprogProcessor'
  4. describe('An assignment to a variable', function () {
  5. const input = `programa {
  6. funcao inicio() {
  7. inteiro a
  8. a = 5.5
  9. }
  10. }`;
  11. const lexer = Lexers['pt_br'];
  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( _ => done());
  18. });
  19. });