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

Using tests from “Violet - Python VM written in Swift” #98

Open
LiarPrincess opened this issue Apr 1, 2022 · 2 comments
Open

Using tests from “Violet - Python VM written in Swift” #98

LiarPrincess opened this issue Apr 1, 2022 · 2 comments

Comments

@LiarPrincess
Copy link
Contributor

LiarPrincess commented Apr 1, 2022

Hi,

As I mentioned in #97 Using ManagedBufferPointer instead of Array as a storage I also implemented my own version of BigInt for Violet - Python VM written in Swift.

The question is: can I merge some of our tests to this repo?

The main idea behind this would be to test our tests. If attaswift/BigInt fails some case then it may mean that the test is wrong, in which case we have to fix our code in Violet.

Violet test suite is quite big (but by no means it is exhausting the test-space). We went with property based testing with means that we test millions of inputs to check if the general rule holds (for example: a+b=c -> c-a=b etc.). This takes time, but pays for itself by finding weird overflows in bit operations (we store “sign + magnitude”, so bit operations are a bit difficult to implement).

You can preview our tests at Violet -> BigIntTests. Though I would advise reading our documentation before, because our design is quite different than yours.

@tgymnich
Copy link
Collaborator

tgymnich commented Apr 1, 2022

Yes, please!
Violets test suite looks way more sophisticated than ours.

@LiarPrincess
Copy link
Contributor Author

LiarPrincess commented Apr 2, 2022

Ok.
I will work on it next week.
Obviously it will be multiple smaller PRs rather than a single big one. All of them will be linked to this issue.

Btw. can I create a new target for it? Something like "VioletBigIntTests". This will simplify the code ownership: everything connected to this target will be owned by me (for example new issue/PR -> I am responsible).

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