Verifies that each row satisfies the phone number spec.
| 216 | |
| 217 | // Verifies that each row satisfies the phone number spec. |
| 218 | void VerifyPhone(const Datum& d) { |
| 219 | int64_t length = d.length(); |
| 220 | const char* phones = reinterpret_cast<const char*>(d.array()->buffers[1]->data()); |
| 221 | constexpr int kByteWidth = 15; // This is common for all PHONE columns |
| 222 | std::regex exp("\\d{2}-\\d{3}-\\d{3}-\\d{4}"); |
| 223 | for (int64_t i = 0; i < length; i++) { |
| 224 | const char* row = phones + i * kByteWidth; |
| 225 | ASSERT_TRUE(std::regex_match(row, row + kByteWidth, exp)); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // Verifies that each decimal is between min and max |
| 230 | void VerifyDecimalsBetween(const Datum& d, int64_t min, int64_t max) { |
no test coverage detected