-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix bitwise.and and add tests #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for your contribution!
To make it complete, we would need tests for the following cases:
- Less number of arguments than expected
- More number of arguments than expected
- Wrong type for argument at each position.
If the tests become large, we could split the files to bitwise/and.yaml
, bitwise/lsh.yaml
etc.
@@ -14,7 +14,7 @@ use anyhow::Result; | |||
|
|||
pub fn register(m: &mut HashMap<&'static str, builtins::BuiltinFcn>) { | |||
m.insert("bits.and", and); | |||
m.insert("bits.and", lsh); | |||
m.insert("bits.lsh", lsh); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
- | | ||
package test | ||
|
||
x = bits.and(1, "str") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also lock down with a test for and(string, number)
as well as with more than two parameters.
Signed-off-by: eric-therond <[email protected]>
206879b
to
f46af00
Compare
Just added more tests following your suggestion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for your contribution!
No description provided.