Skip to content
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

tests: added tests to several methods to increase branch coverage #166

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Snebie
Copy link

@Snebie Snebie commented Feb 25, 2022

Added the tests to a few methods to increase branch coverage. In the process we discovered a bug which is described in issue #165.

By submitting this pull request I confirm I've read and complied with the below requirements.

  • I have read the Contribution guidelines and I am confident that my PR reflects them.
  • I have followed the coding guidelines for this project.
  • My code follows the skeleton code structure.
  • This pull request has a descriptive title. For example, Added {Algorithm/DS name} [{Language}], not Update README.md or Added new code.

Snebie and others added 15 commits February 23, 2022 17:27
…nator, which covers another branch not included in existing tests (#36)
* Relating to #13, test: added test for multiplicationUsingFFT where input is zero

* Fixed #13, test: added test for multiplicationUsingLoopWithStringInput where input is zero, also added requirements comments
Fixed #40. test: Added testKruskalNull to test branch
Fixed #41. tests: Added testKruskalDirected to tests branch
Specifically, made sure that the grow() function is called correctly from the ArrayList implementation of List. This should happen when the underlying array is not large enough to store all elements.
Requirement: If someone tries to remove an element at a negative (i.e. invalid) index in an ArrayList, then null should be returned.
Tests that the private function shrink() in the ArrayList implementation
in the file List.java works correctly.
Requirement: If the size attribute becomes smaller than half the size of the underlying array,
then the shrink() function should be called, which should decrease the size of said array.
…nch. (#63)

Asserted the following requirement:
The validate() function should return false for lists with null elements.
Specifically: put testRemoveInvalidIndex after testShrinkArrayList
@akerfel akerfel deleted the tests branch March 1, 2022 23:16
@akerfel akerfel restored the tests branch March 1, 2022 23:17
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.

None yet

3 participants