| 34 | size_t expected_length); |
| 35 | |
| 36 | static int cte_fixture(char *dir, size_t dir_size, char *path, size_t path_size) { |
| 37 | char *created = th_mktempdir("cbm_text_edit"); |
| 38 | if (!created) { |
| 39 | return -1; |
| 40 | } |
| 41 | int dir_count = snprintf(dir, dir_size, "%s", created); |
| 42 | int path_count = snprintf(path, path_size, "%s/AGENTS.md", created); |
| 43 | if (dir_count < 0 || (size_t)dir_count >= dir_size || path_count < 0 || |
| 44 | (size_t)path_count >= path_size) { |
| 45 | th_cleanup(created); |
| 46 | return -1; |
| 47 | } |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | static int cte_write_bytes(const char *path, const char *data, size_t len) { |
| 52 | FILE *file = cbm_fopen(path, "wb"); |
no test coverage detected