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
Update all <X>TestArbs so that they have a third item in the tuple, the return type, and have the arb generate a default value for a return type, rather than us hard-coding one into the test. Note: this should handle recursion and will need to convert a JS value back into the source code that creates the value... very tricky.
Update the tests to use src.valueLiteral instead of hard-coded tests. Make sure to add valueLiterals to arbs where needed like in variant_arb.ts
We need to do a pass to change returnType.values to returnType.src.valueLiteral. The values work for these primitives, but the code isn't saying what we're intending. So let's just do a pass.
Update the Opt tests to test the Some and None helper function/constant from Azle
Consider making the equality functions on our arbs something that returns a Result so that if our tests fail then we'll see exactly where the two objects weren't equal. Not doing in favor of using a global equals function or an equality assertion in the testing framework.
Consider aggregating all the params into a big list and then generating a query method for each of those that just takes in the one param and returns it. The goal being to have more test-coverage on the encoding of values.
Consider separating the arity of the tests from the arity of the canister methods. We may want to create more tests for each function, or vice-versa. So, we should make this more flexible.
Make a common wrapper function that wraps fast-equals and does checks for Principals and other non-compatible types. That way we just have one common function. This may be a little tricky.
Add an equals assertion to the testing framework that will print out the two values, maybe a nice diff. Once this is complete then you can remove the custom equality checking in record and tuple. @bdemann
All the arbs are very similar. See if we can combine them into some common function or something rather than repeating all this code.
Handle JS Keywords correctly. This may require updating JsFunctionName or making a new generator. Consider the different levels where each type of keyword is valid/invalid.
<X>TestArb
s so that they have a third item in the tuple, the return type, and have the arb generate a default value for a return type, rather than us hard-coding one into the test. Note: this should handle recursion and will need to convert a JS value back into the source code that creates the value... very tricky.src.valueLiteral
instead of hard-coded tests. Make sure to add valueLiterals to arbs where needed like in variant_arb.tsreturnType.values
toreturnType.src.valueLiteral
. The values work for these primitives, but the code isn't saying what we're intending. So let's just do a pass.Opt
tests to test theSome
andNone
helper function/constant from AzleConsider making the equality functions on our arbs something that returns aNot doing in favor of using a global equals function or an equality assertion in the testing framework.Result
so that if our tests fail then we'll see exactly where the two objects weren't equal.JsFunctionName
or making a new generator. Consider the different levels where each type of keyword is valid/invalid.Vec(Null)
. #1453undefined
and sometimes literally nothing.The text was updated successfully, but these errors were encountered: