1
0

testTypeCast.spec.js 513 B

1234567891011121314151617181920
  1. import { IVProgParser } from './../js/ast/ivprogParser';
  2. import { LanguageService } from '../js/services/languageService';
  3. describe('When implicit type casting is enabled', function () {
  4. let input = `programa {
  5. funcao inicio() {
  6. real v = 5
  7. }
  8. }`;
  9. const lexer = LanguageService.getCurrentLexer();
  10. it(`should coerce integer into real`, function () {
  11. const parser = new IVProgParser(input, lexer);
  12. const fun = parser.parseTree.bind(parser);
  13. expect(fun).not.toThrow();
  14. });
  15. });