The Wayback Machine - https://web.archive.org/web/20250523084618/https://github.com/TheAlgorithms/Python/pull/7651
Skip to content

Add tests to maths/binary_exponentiation.py #7651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

MaximSmolskiy
Copy link
Member

@MaximSmolskiy MaximSmolskiy commented Oct 25, 2022

Describe your change:

Increase test coverage from

maths/binary_exponentiation.py                                               15     13    13%   9-17, 21-28

to

maths/binary_exponentiation.py                                               15      7    53%   25-32
  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • 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 have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
@MaximSmolskiy MaximSmolskiy changed the title Add tests to maths/binary exponentiation.py Add tests to maths/binary_exponentiation.py Oct 25, 2022
@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Oct 25, 2022
Copy link
Contributor

@CaedenPH CaedenPH left a comment

Choose a reason for hiding this comment

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

Could you add more tests, at least to this file?

@MaximSmolskiy
Copy link
Member Author

MaximSmolskiy commented Oct 25, 2022

Could you add more tests, at least to this file?

This one test covers all branches (cases), so I think it will be enough

@cclauss
Copy link
Member

cclauss commented Oct 25, 2022

This one test covers all branches (cases), so I think it will be enough

Does it cover negative numbers, zero, large numbers, floating point numbers, large negative floating point numbers, letters? As discussed in CONTRIBUTING.md, tests should demonstrate how the algorithm works and also how it deals with bad input.

@cclauss cclauss closed this Oct 29, 2022
@cclauss
Copy link
Member

cclauss commented Oct 29, 2022

Please do not open new pull requests in this repo until November 1st. 2022.

@MaximSmolskiy MaximSmolskiy deleted the add-tests-to-maths/binary_exponentiation.py branch April 1, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files
3 participants