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

Add meaningful test for linear_map #1036

Closed
schillic opened this issue Jan 20, 2019 · 2 comments · Fixed by #2258
Closed

Add meaningful test for linear_map #1036

schillic opened this issue Jan 20, 2019 · 2 comments · Fixed by #2258
Assignees
Labels
robustness 💪 Tests and checks

Comments

@schillic
Copy link
Member

#1035 fixed a bug where the array of constraints contained undefs. The unit test only checks if the method does not crash. To avoid such problems in the future, we should at least test that each constraint is indeed a constraint.

@schillic schillic added the robustness 💪 Tests and checks label Jan 20, 2019
@mforets
Copy link
Member

mforets commented Jan 20, 2019

One could make a simple but meaningful test in such situation by checking for example that the image of an element is in the linear map:

M = N[2 3; 1 2]   # invertible matrix
MP = linear_map(N[2 3; 1 2], P)  # check concrete linear map
@test M * an_element(P)  MP   # check that the image of an element is in the linear map  

@schillic
Copy link
Member Author

These tests have been added starting in #1080.

@test all([M * p Li for Li in [L1, L2, L3, L4, L5, L6, L7]])

schillic added a commit that referenced this issue Jul 22, 2020
#1036 - Add meaningful test for linear_map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
robustness 💪 Tests and checks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants