While types are not meant to fully replace tests, a single newtype wrapper can eliminate the need for an entire category of tests just because buggy code cannot be written using safe primitives anymore.
Furthermore, the type system hints the developer if some check is missing.
This is an especially useful property for library writers, as their users also get a piece of that safety automatically.Also (this point is often not taken into account) tests may form quite a large codebase that also has to be maintained, so you would like to avoid writing repetitive tests for trivial failure cases where possible.For more details, I recommend Ken Fox’s article explaining why it is beneficial to have both types and tests.