Skip to content

test(palindrome): add edge cases for single characters, numbers, and punctuation (#62) - #65

Open
aadiitya2007 wants to merge 1 commit into
techcsispit:mainfrom
aadiitya2007:test/palindrome-edge-cases
Open

aadiitya2007 wants to merge 1 commit into
techcsispit:mainfrom
aadiitya2007:test/palindrome-edge-cases

Conversation

@aadiitya2007

Copy link
Copy Markdown
Contributor

Closes #62

What I changed

Added comprehensive edge cases to problems/palindrome/cases.txt:

  • Single-character boundary cases (a, Z).
  • Numeric palindromes and non-palindromes (12321, 12345).
  • Alphanumeric boundary sequences (0P, 1a2b3b2a1).
  • Phrases with apostrophes and punctuation (No 'x' in Nixon, Was it a car or a cat I saw?).
  • Strings containing only punctuation symbols (., !?).

How it works

The problem statement requires checking if a string reads the same forwards and backwards after converting all uppercase letters to lowercase and removing all non-alphanumeric characters.

These additional test cases ensure that solutions across all supported languages (C, C++, JavaScript, and Python) properly handle single-character inputs, mixed digits, and symbols without failing boundary checks or character conversion.

Verification

Ran python run.py palindrome across all solution implementations:

  • solution.c: passed
  • solution.cpp: passed
  • solution.js: passed
  • solution.py: passed
    Summary: 4 passed, 0 failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(palindrome): add test cases for single-char, numeric, and punctuation edge cases

1 participant