| 6 | #include "gtest/gtest.h" |
| 7 | |
| 8 | TEST(pretty_binary, print) { |
| 9 | ASSERT_EQ(pretty_binary_string(std::string("foo\001\002bars")), std::string("'foo'0x0102'bars'")); |
| 10 | ASSERT_EQ(pretty_binary_string(std::string("foo''bars")), std::string("'foo''''bars'")); |
| 11 | ASSERT_EQ(pretty_binary_string(std::string("foo\377 \200!!")), std::string("'foo'0xFF2020802121")); |
| 12 | ASSERT_EQ(pretty_binary_string(std::string("\001\002\003\004")), std::string("0x01020304")); |
| 13 | } |
| 14 | |
| 15 | TEST(pretty_binary, unprint) { |
| 16 | ASSERT_EQ(pretty_binary_string_reverse(std::string("'foo'0x0102'bars'")), std::string("foo\001\002bars")); |
nothing calls this directly
no test coverage detected