Skip to content

Commit

Permalink
Testando retorno função com operador ou
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelrvg committed Feb 25, 2024
1 parent 845ebb0 commit 4a83673
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions testes/biblioteca-global.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ describe('Biblioteca Global', () => {

it('Sucesso - filtrarPor', async () => {
const codigo = [
"var valoresLogicos = ['verdadeiro', 'falso', 'falso', 'verdadeiro', 'falso', 'verdadeiro']",
"var f = funcao(valor) { retorna valor == 'verdadeiro' }",
"var valoresLogicos = ['verdadeiro', 'falso', 'falso', verdadeiro, 'falso', 'verdadeiro']",
"var f = funcao(valor) { retorna valor == 'verdadeiro' ou valor == verdadeiro }",
"var valoresVerdadeiros = filtrarPor(valoresLogicos, f)",
"escreva(valoresVerdadeiros)"
];
const retornoLexador = lexador.mapear(codigo, -1);
const retornoAvaliadorSintatico = avaliadorSintatico.analisar(retornoLexador, -1);

interpretador.funcaoDeRetorno = (saida: any) => {
expect(saida).toEqual('[\'verdadeiro\', \'verdadeiro\', \'verdadeiro\']');
expect(saida).toEqual('[\'verdadeiro\', verdadeiro, \'verdadeiro\']');
};

const retornoInterpretador = await interpretador.interpretar(retornoAvaliadorSintatico.declaracoes);
Expand Down

0 comments on commit 4a83673

Please sign in to comment.