Skip to content

✅ Add doctests to string conversion functions - #12839

Closed
Nitin-Prata wants to merge 4 commits into
TheAlgorithms:masterfrom
Nitin-Prata:add-doctests-min-cost-string
Closed

Nitin-Prata wants to merge 4 commits into
TheAlgorithms:masterfrom
Nitin-Prata:add-doctests-min-cost-string

Conversation

@Nitin-Prata

@Nitin-Prata Nitin-Prata commented Jul 10, 2025

Copy link
Copy Markdown

Describe your change:

Contributes to #9943
Closes #13601

  • Added doctests for compute_transform_tables and assemble_transformation
  • Covered edge cases like empty strings and common transformations
  • Verified all doctests pass via python -m doctest -v
  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeper algorithms-keeper Bot added tests are failing Do not merge until tests pass and removed tests are failing Do not merge until tests pass labels Jul 10, 2025
@Nitin-Prata

Copy link
Copy Markdown
Author

Hi,
This PR adds doctests to string_conversion.py and all checks have passed.
It’s been reviewed and approved by two contributors.
Could someone with write access please review or merge it?

Copilot AI lite review requested due to automatic review settings September 16, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The PR description must mark the doctest change option to avoid automatic closure.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds and refines doctests for string conversion functions without changing runtime behavior.

Changes:

  • Adds an empty-string doctest.
  • Simplifies transformation examples.
  • Corrects docstring wording.
File summaries
File Description
strings/min_cost_string_conversion.py Updates doctest examples and documentation.

Review note: Select “Add or change doctests?” in the pull request description.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +24 to +25
>>> compute_transform_tables("", "", 1, 2, 3, 3)
([[0]], [['0']])
@cclauss cclauss closed this Sep 16, 2026
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.

5 participants