test04.spec.js 644 B

123456789101112131415161718192021222324252627
  1. import {
  2. IVProgParser
  3. } from './../js/ast/ivprogParser';
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('Literal arrays that have more than 2 dimensions', () => {
  6. let input = `programa {
  7. const inteiro a[1][1] = {
  8. {
  9. {1,2},
  10. {3,4}
  11. }
  12. }
  13. funcao inicio() {
  14. retorna
  15. }
  16. }`;
  17. const lexer = LanguageService.getCurrentLexer();
  18. it(`should result in SyntaxError`, () => {
  19. const as = new IVProgParser(input, lexer);
  20. const fun = as.parseTree.bind(as);
  21. expect(fun).toThrow();
  22. });
  23. });