-
Notifications
You must be signed in to change notification settings - Fork 42
Feature/test infastructure (Resposta ao Issue "Review the implementation of the Testing Infrastructure") #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rbonifacio
merged 19 commits into
UnBCIC-TP2:main
from
The3rdMega:feature/test-infastructure
Jul 25, 2025
Merged
Feature/test infastructure (Resposta ao Issue "Review the implementation of the Testing Infrastructure") #50
rbonifacio
merged 19 commits into
UnBCIC-TP2:main
from
The3rdMega:feature/test-infastructure
Jul 25, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Este commit adiciona a função parse_test_function_definition_statement, que realiza o parser de TestDef em r-python, bem como testes para garantir que o parser funcione corretamente. Este commit também altera a função parse_function_definition_statement, para rejeitar funções cujo identificador se inicia com "test", também possuindo um teste para realizar esta checagem. Observações: - Parser de Declaração de Funções comuns está quebrado, isso dado a função keyword, que está consumindo o espaço após de KEYWORD_DEF e assumindo que def é uma palavra maior, quebrando parsers que utilizam a keyword def.
…unções de teste Agora retornamos Error<input> ao invés de Error<name>, para retornar no erro a string original de texto no parser que deu erro
Ainda falta implementar testes para os Asserts
Asserts executam no interpretador e retornam um Computation Continue caso passem ou Erro caso falhem. Environments podem armazenar declaração de testes (ainda a ser implementado pelo TestDef)
Testes agora armazenam TestResult no environment. A função run_tests no interpretador recebe um programa, executa ele por inteiro e depois roda todos os testes presentes no programa, retornando um Vec<TestResult> Testes definidos em um programa são armazenados no escopo no hashmap tests. Vec<TestResult> ainda não está sendo armazenado no environment. Mas é possível implementar de maneira indolor. Interpretador de Asserts finalizada, agora eles retornam Computation::Continue ou Err(e), com a string de erro presente dentro do Assert. Cargo.toml agora requer uso de IndexMap para armazenar TestResults ordenados na ordem de definição dos testes.
Alterado lookup_function -> lookup_test Alterado map_function -> map_test
Adicionada a função auxiliar check_block para validar blocos com escopo. Refatorada check_test_function_stmt para usar check_block, corrigir ownership e utilizar lookup_test/map_test. Criada suíte de testes unitários cobrindo casos válidos e inválidos para TestDef.
- Separados os testes a apresentar para o Bonifácio em Módulos para fácil acesso. - Adicionados TODO's para fácil navegação do código na apresentação. - Testes do TypeChecker de TesteDef agora checam se a mensagem de erro foi a mensagem desejada.
Also cleaned some TODO's
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Este Pull Request corresponde a entrega do Projeto final da Matéria de Técnicas de Programação 2 com o Professor Rodrigo Bonifácio, no semestre de 2025.1.
Membros do Grupo:
Modificações Feitas
Environment:
Parser:
TypeChecker:
Interpreter:
Testes Unitários:
Novas Dependências
Quality of Life: