random_age Class not returning test cases
#1020
Merged
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.
This pull request rectifies a bug in the
randomize_ageTest within langtest. Previously, the function failed to return the generated test cases after processing the input samples.Details:
The issue stemmed from placing the
appendstatement within the loop iterating over samples. Originally, theappendwas placed after the loop, resulting in the generated test cases not being added to theperturbed_sampleslist.The fix involves moving the append statement inside the loop after the test case and generating transformations using
randomize_ages(s.original). This ensures that each processed sample's test case is captured before moving on to the next iteration.Benefits:
This fix guarantees that the
randomize_agesfunction correctly returns the generated test cases, enabling proper execution of the testing suite.By successfully returning the test cases, you can validate your language processing capabilities for handling age-related scenarios within your robustness testing framework.