| 83 | return cbm_path_info_utf8(path, &info) == CBM_PATH_INFO_ABSENT; |
| 84 | } |
| 85 | static bool pf_file_is(const char *path, const char *text) { |
| 86 | char data[4096]; |
| 87 | size_t len = strlen(text); |
| 88 | if (len >= sizeof(data)) |
| 89 | return false; |
| 90 | FILE *file = cbm_fopen(path, "rb"); |
| 91 | if (!file) |
| 92 | return false; |
| 93 | size_t n = fread(data, 1, len + 1, file); |
| 94 | bool ok = n == len && !memcmp(data, text, len) && !ferror(file); |
| 95 | return fclose(file) == 0 && ok; |
| 96 | } |
| 97 | static bool pf_files_equal(const char *a, const char *b) { |
| 98 | FILE *left = cbm_fopen(a, "rb"), *right = cbm_fopen(b, "rb"); |
| 99 | bool ok = left && right; |
no test coverage detected