-
Notifications
You must be signed in to change notification settings - Fork 83
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(test): missing function parameters #461
Conversation
I also note trailing semicolons on some of the lines. They clearly aren't breaking any of the tests, but I didn't think they were necessary in Amber scripts?
|
// Output | ||
// 1100 | ||
|
||
fun sum_array(a : [Num] = [Num]): Num { |
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.
Why is the default value a type? Doesn't it raise any errors while compiling?
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.
No doesn't, those are the tests for that feature that were missing after implement the feature.
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.
I still dont understand this. Why do we allow for type to be a default value? What is the usecase?
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.
I don't know, I just migrated the test from the PR that was approved and were missing in the actual codebase.
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.
If this test succeeds, this is worth opening an issue about.
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.
tests right now works, if someone want to open a ticket about it to me is fine :-)
This are stuff for another discussion but right now there isn't any code style for amber itself. |
// Output | ||
// 1000 | ||
|
||
fun sum_array(a : [Num] = [100,200,300,400]): Num { |
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.
im pretty sure its supposed to be a: [Num]
, not a : [Num]
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.
right now the tests are working in this way, maybe is just defining a array with numbers?
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, just the code formatting thing
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.
There are still a couple of issues with function_optional_argument_array.ab
and function_optional_argument_array_default.ab
, where you're echoing the expected value, not the value returned by the function under test. So you're asserting that 1000
equals 1000
, which is probably not what you meant.
Thanks everyone I just imported the test from the PR mentioned and that were missing but is clear that they had some issues and we didn't noticed when we approved it. |
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.
* fix(test): missing function parameters * Update function_optional_argument_array.ab * fix(test): after review * fix(test): review
I noticed that the tests implemented on #260 are missing in the actual release.
Probably during the various PR and changes they are gone.
This PR will implement back.