You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exercise Top Secret, decode_secret_message_part/2 function. I believe there should be another test when the AST (the first argument of the fucntion) is formed from the code consisting of only primitive types such as 12 or :ok.
For example, if ast = TopSecret.to_ast("12") or ast = TopSecret.to_ast(":ok"), then TopSecret.decode_secret_message_part(ast, acc) should return {ast, acc}. However, there is no test for that; all the tests assume that the AST is formed from the code containing a function. One could pass all the tests even though the function raises an ArgumentError for such an argument. This test could as well help the solver with task the Task 5 of the exercise as some nodes simply contain only primitive types; took me quite some time to notice that one should check if the ast in the function is actually a tuple.
I am willing to do this myself, but if I am correct one should first open an issue here.
The text was updated successfully, but these errors were encountered:
Hi! Thank you for the suggestion - it's a very good one. I would be very happy to see a PR from you with that improvement 🙂. The new test should be a separate test case, probably added after the existing "returns the AST and accumulator unchanged" test.
Exercise Top Secret,
decode_secret_message_part/2
function. I believe there should be another test when the AST (the first argument of the fucntion) is formed from the code consisting of only primitive types such as12
or:ok
.For example, if
ast = TopSecret.to_ast("12")
orast = TopSecret.to_ast(":ok")
, thenTopSecret.decode_secret_message_part(ast, acc)
should return{ast, acc}
. However, there is no test for that; all the tests assume that the AST is formed from the code containing a function. One could pass all the tests even though the function raises anArgumentError
for such an argument. This test could as well help the solver with task the Task 5 of the exercise as some nodes simply contain only primitive types; took me quite some time to notice that one should check if the ast in the function is actually a tuple.I am willing to do this myself, but if I am correct one should first open an issue here.
The text was updated successfully, but these errors were encountered: