test12.spec.js 617 B

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