Add tests for formatUnit

The pseudo code is not commented out so I couldn't test if the tests run and fail :)