Closed ameeratgithub closed 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 86.54%. Comparing base (
13792d0
) to head (35f129f
). Report is 342 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Acaccia could you take a look at it again?
The tests for the functions definitions don't test at all if the arguments are accessible. They should be used in the function body.
There are no tests to prove that any type could be returned from private and read-only functions. Same for public function, it could show more kind of return types than (response int).
I'm not sure I understood this. Consider following example
>> (define-public (func) 1)
<stdin>:1:1: error: public functions must return an expression of type 'response', found 'int'
@ameeratgithub
Your tests should make sure that all the function's arguments are accessible. I would personally write a function that takes any number of arguments and returns a tuple which uses them all. -> This test would prove that the function can take any number of arguments of any type and use them all in the function body.
I would also make a function that can take also any number of random arguments and returns a randomly generated value. -> This test would prove that a function can return any type.
For the public function, you can generate a random response value like this:
response in (prop_signature(), prop_signature()).prop_flat_map(|(ok_ty, err_ty)| PropValue::from_type(TypeSignature::ResponseType(Box::new((ok_ty, err_ty)))))
@Acaccia thanks for the details. Hopefully it will be good now.
This was implemented by #289. Can be closed.
closes #289