bignumber_test_printers.h 911 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // bignumber_test_printers.h
  3. // bigdecimal
  4. //
  5. // Created by Sam Jaffe on 5/20/18.
  6. //
  7. #pragma once
  8. #include "math/bigdecimal.h"
  9. #include "math/biginteger.h"
  10. #include <iosfwd>
  11. #include <string>
  12. #include <tuple>
  13. #pragma clang diagnostic push
  14. #pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
  15. #include <gmock/gmock.h>
  16. #pragma clang diagnostic pop
  17. struct ArithTuple {
  18. math::bigdecimal lhs, rhs;
  19. std::string expected;
  20. };
  21. struct BigDecPair {
  22. math::bigdecimal lhs, rhs;
  23. };
  24. using BigIntPair = std::tuple<math::biginteger, math::biginteger>;
  25. namespace math {
  26. void PrintTo(math::bigdecimal const & dec, std::ostream * out);
  27. void PrintTo(math::biginteger const & dec, std::ostream * out);
  28. }
  29. void PrintTo(BigDecPair const & tup, std::ostream * out);
  30. void PrintTo(ArithTuple const & tup, std::ostream * out);
  31. namespace std {
  32. void PrintTo(BigIntPair const & tup, std::ostream * out);
  33. }