DescriptionObjective: There are several issues related to string handling in the PrintLetters class as highlighted by the current test cases in PrintLettersTest. Specifically, the handling of inputs with digits and empty strings needs to be reviewed.
Acceptance Criteria:
[x] Review the logic in the PrintLetters class to ensure it correctly handles these scenarios.
[x] Consider adding additional test cases to cover other edge cases (e.g., strings with special characters).
[ ] Ensure that all error messages are consistent and clear.
Test Cases
Valid Input Test
Input: "a1b2c3"
Expected Output: "abbcc"
Issue: This test currently passes, but we should verify that the logic in PrintLetters handles all cases correctly.
Empty String Test
Input: ""
Expected Output: "Invalid input: string is empty"
Issue: The output is correct, but we need to ensure this case is handled at the start of the PrintLetters.main() method.
Starts With Digit Test
Input: "1a2b"
Expected Output: "Invalid input: string should not start with a digit"
Issue: The output is correct, but we need to validate that this check is effectively implemented.
Description Objective: There are several issues related to string handling in the
PrintLetters
class as highlighted by the current test cases inPrintLettersTest
. Specifically, the handling of inputs with digits and empty strings needs to be reviewed.Acceptance Criteria:
PrintLetters
class to ensure it correctly handles these scenarios.Test Cases
Valid Input Test
"a1b2c3"
"abbcc"
PrintLetters
handles all cases correctly.Empty String Test
""
"Invalid input: string is empty"
PrintLetters.main()
method.Starts With Digit Test
"1a2b"
"Invalid input: string should not start with a digit"