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

Replaced the tests of Binary Trees that need manual string matching #304

Merged
merged 2 commits into from
Dec 8, 2020

Conversation

rsriramc
Copy link
Contributor

@rsriramc rsriramc commented Dec 7, 2020

References to other Issues or PRs or Relevant literature

Closes #294

Brief description of what is fixed or changed

Replaced the testing techniques of Binary Trees where initially a manual string has to be fed; to the check of In-order and Pre-order traversals.

Other comments

Since a unique tree exists with a set of In-order and Pre-order traversals, this check is comparatively easy to use as there is no need of feeding a string of the nodes, instead of which two sets of keys of nodes are fed.

@codecov
Copy link

codecov bot commented Dec 7, 2020

Codecov Report

Merging #304 (7da53d1) into master (3f3faad) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #304   +/-   ##
=========================================
  Coverage   98.866%   98.866%           
=========================================
  Files           25        25           
  Lines         2999      2999           
=========================================
  Hits          2965      2965           
  Misses          34        34           

Impacted file tree graph

@czgdp1807
Copy link
Member

Seems good. Will merge tomorrow.

@czgdp1807
Copy link
Member

There is this function which isn't tested. May be the tests for only this method can be kept along side the new tests.

@rsriramc
Copy link
Contributor Author

rsriramc commented Dec 7, 2020

There is this function which isn't tested. May be the tests for only this method can be kept along side the new tests.

There since I have replaced all the tests of the binary trees ,and all its derivatives. The __str__ method is not at all used in the tests except in one position which is here

But here comes two issues that the __str__ method is redefined in the Cartesian tree, which is not at all called in the test_binary_tree.

So code coverage has been reduced.

@rsriramc
Copy link
Contributor Author

rsriramc commented Dec 7, 2020

Shall I add explicit tests for the __str__ for both the basic binary tree and the redefined __str__ in the Cartesian tree; and add a commit to this?

@czgdp1807
Copy link
Member

Yes. Sure

@rsriramc
Copy link
Contributor Author

rsriramc commented Dec 7, 2020

I have added the tests for the __str__ methods

@czgdp1807 czgdp1807 changed the title Replaced the tests of Binary Trees that need manual string input Replaced the tests of Binary Trees that need manual string matching Dec 8, 2020
@czgdp1807 czgdp1807 merged commit 42832f7 into codezonediitj:master Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace tests of binary tree with in-order and pre-order
2 participants