Browse Source

Fix test cases according to the new type conversion

Lucas de Souza 5 years ago
parent
commit
13714a3957

+ 1 - 1
tests/test22.spec.js

@@ -8,7 +8,7 @@ describe('An assignment to a variable', function () {
   const input = `programa {
 
     funcao inicio() {
-      inteiro a
+      logico a
       a = 5.5
     }
   }`;

+ 1 - 1
tests/test38.spec.js

@@ -22,7 +22,7 @@ describe('The write function', function () {
     const exec = new IVProgProcessor(parser.parseTree());
     exec.registerOutput(output);
     exec.interpretAST().then(sto => {
-      expect(output.list).toEqual(['8.01']);
+      expect(output.list).toEqual([8.01]);
       done();
     }).catch( err => done(err));
   });

+ 1 - 1
tests/test40.spec.js

@@ -30,7 +30,7 @@ describe('The LanguageService', function () {
     const exec = new IVProgProcessor(parser.parseTree());
     exec.registerOutput(output);
     exec.interpretAST().then(sto => {
-      expect(output.list).toEqual(['8.01']);
+      expect(output.list).toEqual([8.01]);
       LanguageService.setLang('pt');
       done();
     }).catch( err => done(err));

+ 2 - 2
tests/test45.spec.js

@@ -11,8 +11,8 @@ describe('The semantic analyser', function () {
       a = aNumber()
     }
 
-    funcao inteiro aNumber () {
-      retorne 3
+    funcao logico aNumber () {
+      retorne verdadeiro
     }
   }`;
 

+ 1 - 1
tests/test51.spec.js

@@ -8,7 +8,7 @@ describe('A invalid relational operation inside an if', function () {
 
     funcao inicio() {
       inteiro a = 5
-      se ( a * 2.3 > 8) {
+      se ( a * 2.3 > "um texto") {
         a = 8
       } senao {
         a = -1

+ 1 - 1
tests/test57.spec.js

@@ -25,7 +25,7 @@ describe('Is_Real function ', function () {
     const exec = new IVProgProcessor(sem.analyseTree());
     exec.registerOutput(out);
     exec.interpretAST().then(_ => {
-      expect(out.list).toEqual([true]);
+      expect(out.list).toEqual(["verdadeiro"]);
       done();
     }).catch(err => done(err));
   });

+ 1 - 1
tests/test66.spec.js

@@ -29,7 +29,7 @@ describe('Non initialized matrix', function () {
             mat[i][j] = j
           } senao se (j == 0) {
             mat[i][j] = i
-          } senao se (char_at(str1, i-1) == char_at(str2, j-1)) {
+          } senao se (texto_na_posicao(str1, i-1) == texto_na_posicao(str2, j-1)) {
             mat[i][j] = mat[i-1][j-1]
           } senao {
             mat[i][j] = 1 + Matematica.minimo({mat[i][j-1], mat[i-1][j], mat[i-1][j-1]})