nholthaus / units

a compile-time, header-only, dimensional analysis and unit conversion library built on c++14 with no dependencies.
http://nholthaus.github.io/units/
MIT License
961 stars 137 forks source link

Unit Testing With Units #183

Closed garethellis0 closed 6 years ago

garethellis0 commented 6 years ago

I'm working on a project right now using this library (which is amazing btw! :tada:), and am trying to unit test some classes using Google Test. Right now it seems like to do any assertions I have to cast all units to doubles before passing them to the assertion, which is doable but irritating. Is this the recommended method? Or have others come up with something more clever?

My apologies if this is not the appropriate place for this, please feel free to close if so.

Thanks!

garethellis0 commented 6 years ago

Closing because I just realized that it wasn't working for me because of other silly mistakes I made. Sorry!