test12.spec.js 644 B

12345678910111213141516171819202122232425
  1. import {
  2. IVProgParser
  3. } from './../js/ast/ivprogParser';
  4. import { LanguageService } from '../js/services/languageService';
  5. describe('SwitchCase command', () => {
  6. let input = `funcao inteiro test(real i) {
  7. escolha (i) {
  8. caso 1:
  9. retorne 0
  10. caso contrario:
  11. retorne 4
  12. }
  13. }`;
  14. const lexer = LanguageService.getCurrentLexer();
  15. it(`should not result in SyntaxError`, () => {
  16. const as = new IVProgParser(input, lexer);
  17. as.pushVariableStack();
  18. const fun = as.parseFunction.bind(as);
  19. expect(fun).not.toThrow();
  20. as.popVariableStack();
  21. });
  22. });