Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Making sets work with complex elements #935

Merged
merged 2 commits into from Dec 28, 2018

Conversation

AnimeshSinha1309
Copy link
Contributor

Changes

Changed the definition of the function Complex.hashCode() to just create an ArrayList, add the real and imaginary parts to it, and then get the value returned by calling the hashing function on the ArrayList.

Fixing tests

One unexpected success in testing in test_complex_element (Trying #36).

test_complex_element (tests.datatypes.test_set.SetTests) ... unexpected success

The hashCode function in the complex class seemed to recurse infinitely, changed it to the hash function of a 2-element ArrayList.
Hopefully fixes test_set.test_complex_element which tries to make and print a set of complex numbers.
@AnimeshSinha1309
Copy link
Contributor Author

AnimeshSinha1309 commented Dec 27, 2018

Can someone help me out, I cannot seem to find a test that is failing in the smoke build.

======================================================================
UNEXPECTED SUCCESS: tests/datatypes/test_set.py::SetTests::test_complex_element
Unexpected success
----------------------------------------------------------------------
Ran 15944 tests in 513.00s
FAILED (expected failures=768, unexpected successes=1)

Where is the failure in the test that should have passed, just an unexpected success.
Am I supposed to remove the @expectedfailure decorator over the method that now works?

Removed the expected failure decorator from the test that is now fixed.
Copy link
Collaborator

@eliasdorneles eliasdorneles left a comment

Choose a reason for hiding this comment

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

Thanks!

@eliasdorneles eliasdorneles merged commit 1ba4e6f into beeware:master Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants