CATROID-1675 Add Robolectric unit tests for AI Tutor diff and validation#5224
Open
harissabil wants to merge 1 commit into
Open
CATROID-1675 Add Robolectric unit tests for AI Tutor diff and validation#5224harissabil wants to merge 1 commit into
harissabil wants to merge 1 commit into
Conversation
- Add `AiTutorSpriteValidatorTest` to ensure sprites are correctly validated and handle missing formula errors - Add `BrickTextFormatterTest` to verify brick labels, data names, and dynamic tokenization for diff views - Add `SpriteDifferTest` to cover diff scenarios including identical sprites, brick additions, removals, and modifications
|
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
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.



Summary
Adds Robolectric unit tests for the AI Tutor's diff and validation logic, which previously had no coverage. All three suites live under
catroid/src/test/java/org/catrobat/catroid/test/robolectric/aiassist/.AiTutorSpriteValidatorTest— coversAiTutorSpriteValidator.validate: complete/empty/multi-script sprites areValid, and a brick missing a required formula isInvalidwith a reason naming the brick and field.BrickTextFormatterTest— coversdataNames,brickEditorLabel,brickPhraseTokens, andscriptHeaderTitle, including spinner selections, inline field values, runtime unit labels, and changed-value flagging.SpriteDifferTest— coversbuildDiffRows: identical sprites, appended/deleted bricks, value changes (MODIFIED), and that different brick classes are not merged into a modification.explore-ai-tutor-integration(the AI Tutor first integration PR) and targets it, since theaiassistpackage isn't indev-ai-tutoryet.Note for reviewers (building locally)
This branch depends on the AI Tutor library (
org.catrobat:aitutor), which is resolved from your Maven Local repository. To build, you first need to publish it locally:integration/pocket-codebranch: https://github.com/Catrobat/catrobat-ai-tutor/tree/integration/pocket-code./gradlew publishToMavenLocal@harissabil - ping me on Slack if the local install gives you any trouble and I'll walk you through it.
Your checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.