Skip to content

Better tests

Philipp Dobler requested to merge better-tests into main

assert_approx_eq (specifically how we used it) was a bad choice for testing. This has led to tests passing although they should pass in the past. Therefore, this merge request switches to approx, which fits our needs. All abs methods have been removed in favour of (optional) implementations of the required approx traits.

Other changes include:

  • remove Mat4::maximum_norm as it is no longer needed
  • implement Mul<Mat4> for <f64> to allow multiplying f64 with Mat4 from left and right
  • add Bounds3::corners
  • enable feature documentation for all crates
  • disable running of example in lib.rs

I also added a bunch of new tests which already caught a few bugs, which have now been fixed:

  • tiled rendering didn't work correctly in some cases (e.g. when the image is smaller than the tile size)
  • when scaling triangle meshes their normals were also scaled
  • Transform::transform_bounds produced wrong results

Last but not least I've also added CI to catch errors faster and more easily.

Merge request reports