sora2-network
sora2-network copied to clipboard
[Tech]: Rewrite `assert_approx_eq` tests to `assert_eq`
Problem statement
Macro assert_approx_eq
should be deprecated and tests that use it should be rewritten to assert_eq
. For example, this can be done by performing the same fixed-point computations within the tests and comparing the results (which should be exactly equal).
Description
We use fixed-point arithmetics since financial applications require exact computations; therefore testing should consider this aspect and check for exact values. It is highly discouraged to allow room for error when counting assets.
Definition of Done
- Macro is marked as deprecated
- Tests are rewritten
Requirements
- The tests should not just copy the code of tested functions, but they should use formulae from them to compute expected values.