Skip to content

test: add palindrome edge-case doctests - #15609

Merged
cclauss merged 1 commit into
TheAlgorithms:masterfrom
devam007:codex/palindrome-edge-case-doctests
Oct 20, 2026
Merged

cclauss merged 1 commit into
TheAlgorithms:masterfrom
devam007:codex/palindrome-edge-case-doctests

Conversation

@devam007

Copy link
Copy Markdown
Contributor

Describe your change

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- No algorithm logic is changed.
  • Documentation change?

Add six edge-case examples to strings/palindrome.py: empty input for the
four ordinary palindrome implementations, punctuation-only input for the
normalizing implementation, and a non-palindromic input containing digits.
These document existing behavior and protect against dropping digits during
normalization. This is a test-coverage improvement, not an algorithm bug fix.

Validation

Locally on Python 3.12.8:

python -B -m doctest -v strings/palindrome.py
python -B -m pytest strings/palindrome.py --doctest-modules -p no:cacheprovider -q
python -B -m ruff check --no-cache strings/palindrome.py
python -B -m ruff format --check --no-cache strings/palindrome.py
git diff --check

All 15 doctest examples pass, collected as five pytest items. Ruff checks and
the whitespace check pass. The full suite and upstream Python 3.15t environment
have not been run locally.

Checklist

  • I have read CONTRIBUTING.md and AGENTS.md.
  • This PR changes only one algorithm file and only its doctest examples.
  • Existing and added examples pass the targeted local checks above.

Prepared with Codex AI assistance as a beginner contribution. No new algorithm,
independent-authorship claim, or upstream CI result is claimed.

@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Oct 19, 2026
@cclauss
cclauss merged commit 6e03a48 into TheAlgorithms:master Oct 20, 2026
6 checks passed
@algorithms-keeper algorithms-keeper Bot removed the awaiting reviews This PR is ready to be reviewed label Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants