-
Notifications
You must be signed in to change notification settings - Fork 6
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
Invalid DSL when using assignment with function call #544
Comments
Since TESTed has to infer the type of the variable, we may need to add type information about the return value of the function. No idea how to specify that information in the DSL, so I'll ask @niknetniko. Could you try doing it this way, so with an explicit
|
One way is to use Python type annotations: - tab: sortWords
contexts:
- testcases:
- statement: 'result: map = count_words(["Gobber", "Hiccup", "Astrid", "Stoick", "Toothless"], "httyd.txt")'
# ^^^^^ add this
- expression: 'sort_words(result)'
return: ["Hiccup", "Toothless", "Stoick", "Astrid", "Gobber"] Also note I have used snake case for the function names; otherwise TESTed should print warnings. When I run the original test suite locally, I do get an error which says what is wrong, so not sure why did not get that:
|
When trying to make an exercise with a statement that has an assignment using a function call (as in the example below), You will get an invalid DSL error with no extra info. I was able to track a part of the problem down to here. In this case the type would FunctionType.FUNCTION.
The text was updated successfully, but these errors were encountered: