test26.spec.js 747 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('Assigning a line from a matrix to another vector', function () {
  6. let input = `programa {
  7. funcao inicio() {
  8. inteiro a[2][2] = {{5,2},{8,6}}
  9. inteiro b[2] = a[0]
  10. }
  11. }`;
  12. const lexer = Lexers['pt_br'];
  13. it(`should result in a valid state`, function (done) {
  14. const parser = new IVProgParser(input, lexer);
  15. const exec = new IVProgProcessor(parser.parseTree());
  16. exec.interpretAST().then(sto => {
  17. expect(sto.applyStore('b')).toBeTruthy();
  18. done();
  19. }).catch( err => done(err));
  20. });
  21. });