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

Test and bugfix equality testing with different degree polynomials. #45

Open
carver opened this issue Jan 21, 2019 · 1 comment
Open

Comments

@carver
Copy link
Collaborator

carver commented Jan 21, 2019

What is wrong?

If I read the current implementation of FQP.__eq__ correctly, it returns True for this test:

FQP([1, 2, 3], ...) == FQP([1, 2], ...)

which seems wrong.

In the current implementation, zip terminates on the shorter list, and there's no explicit length/degree check.

How can it be fixed

Add tests for related scenarios, and make sure implementation is correct.

Also, because of the type checking involved, make sure that the equality test is commutative when the class is different, like:

fq2_a = FQP([2, 3], (1, 0))
fq2_b = FQ2([2, 3], (1, 0))

assert fq2_a == fq2_b
assert fq2_b == fq2_a
@Bhargavasomu
Copy link
Contributor

As an extension to this issue, it would ideally be better, if all the places in the code where the zip function is used be tested in some way (probably unittests).

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

No branches or pull requests

2 participants