-
Notifications
You must be signed in to change notification settings - Fork 143
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
Improved type safety tests #494
Commits on Jul 9, 2019
-
Combinatorial enumeration helper
Add a utility function which calls the provided closure for all possible combination of arguments from the provided arrays. This function allows testing multiple combinations of various invalid arguments and ensure that we don't miss any of them. Enjoy your dynamic typing experience.
Configuration menu - View commit details
-
Copy full SHA for 5452f2d - Browse repository at this point
Copy the full SHA 5452f2dView commit details -
Strict type checks in key generation functions
Add tests to verify that key generation functions do not accept any generally invalid arguments, such as "null", "undefined", etc. We accept only byte arrays. No strings, no integer arrays, no promises of arrays. Just Monika^W bytes.
Configuration menu - View commit details
-
Copy full SHA for e0cb760 - Browse repository at this point
Copy the full SHA e0cb760View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84526dd - Browse repository at this point
Copy the full SHA 84526ddView commit details -
Strict type checks in Secure Cell
Ensure that we disallow any unexpected types in Secure Cell input. There are a few exceptions from the generally invalid types: - Secure Cell accepts "null" values for context in Seal and Token Protect modes. But not for other arguments, and not in the Context Imprint mode. - Context Imprint mode has a custom error for "undefined" context value which is possible if the user omits the context argument (mistakingly assuming that it is optional) In all other cases we expect a TypeError to be thrown.
Configuration menu - View commit details
-
Copy full SHA for 07b64f4 - Browse repository at this point
Copy the full SHA 07b64f4View commit details -
Strict type checks in Secure Message
Ensure that we disallow any unexpected types in Secure Message input. The expectations are regular. However, in Secure Message constructor we produce Themis errors instead of TypeErrors.
Configuration menu - View commit details
-
Copy full SHA for 0268af6 - Browse repository at this point
Copy the full SHA 0268af6View commit details -
Strict type checks in Secure Comparatore
Ensure that we disallow any unexpected types in Secure Comparator.
Configuration menu - View commit details
-
Copy full SHA for 9a44a45 - Browse repository at this point
Copy the full SHA 9a44a45View commit details -
Strict type checks in Secure Session
Ensure that we disallow any unexpected types in Secure Session.
Configuration menu - View commit details
-
Copy full SHA for 53a45be - Browse repository at this point
Copy the full SHA 53a45beView commit details -
Keys cannot be constructed from empty strings
Actually, keys cannot be constructed from any string at the moment, but let's test this specifically because we rely on PrivateKey and PublicKey to contain valid non-empty keys at all times.
Configuration menu - View commit details
-
Copy full SHA for 5515803 - Browse repository at this point
Copy the full SHA 5515803View commit details -
Replace clever hack with standard forEach loop
It turned out that I did not actually need that combinatorial hack so replace it with a more straightforward forEach loop. Well, that was a nice exercise.
Configuration menu - View commit details
-
Copy full SHA for 1d92862 - Browse repository at this point
Copy the full SHA 1d92862View commit details