diff --git a/tests/byte_tests.cpp b/tests/byte_tests.cpp index 59ff0cd..3bbf382 100644 --- a/tests/byte_tests.cpp +++ b/tests/byte_tests.cpp @@ -96,6 +96,24 @@ SUITE(byte_tests) a >>= 4; CHECK(a == to_byte<0x0F>()); } + + TEST(to_integer) + { + byte b = to_byte<0x12>(); + + CHECK(0x12 == gsl::to_integer(b)); + CHECK(0x12 == gsl::to_integer(b)); + CHECK(0x12 == gsl::to_integer(b)); + CHECK(0x12 == gsl::to_integer(b)); + + CHECK(0x12 == gsl::to_integer(b)); + CHECK(0x12 == gsl::to_integer(b)); + CHECK(0x12 == gsl::to_integer(b)); + CHECK(0x12 == gsl::to_integer(b)); + +// CHECK(0x12 == gsl::to_integer(b)); // expect compile-time error +// CHECK(0x12 == gsl::to_integer(b)); // expect compile-time error + } } }