test26.spec.js 754 B

12345678910111213141516171819202122232425
  1. import { IVProgParser } from './../js/ast/ivprogParser';
  2. import { IVProgProcessor} from './../js/processor/ivprogProcessor'
  3. import { LanguageService } from '../js/services/languageService';
  4. describe('Assigning a line from a matrix to another vector', function () {
  5. let input = `programa {
  6. funcao inicio() {
  7. inteiro a[2][2] = {{5,2},{8,6}}
  8. inteiro b[2] = a[0]
  9. }
  10. }`;
  11. const lexer = LanguageService.getCurrentLexer();
  12. it(`should result in a valid state`, function (done) {
  13. const parser = new IVProgParser(input, lexer);
  14. const exec = new IVProgProcessor(parser.parseTree());
  15. exec.interpretAST().then(sto => {
  16. expect(sto.applyStore('b')).toBeTruthy();
  17. done();
  18. }).catch( err => done(err));
  19. });
  20. });