| 2035 | } |
| 2036 | |
| 2037 | static int jl_write_document(const char *path, const char *content, size_t length, |
| 2038 | const char *expected_content, size_t expected_length, |
| 2039 | const jl_file_snapshot_t *expected_snapshot) { |
| 2040 | size_t root = 0; |
| 2041 | if (jl_validate_document(content, length, &root) != 0) { |
| 2042 | return -1; |
| 2043 | } |
| 2044 | return jl_write_atomic(path, content, length, expected_content, expected_length, |
| 2045 | expected_snapshot); |
| 2046 | } |
| 2047 | |
| 2048 | #ifdef CBM_JSON_LIKE_ENABLE_TEST_API |
| 2049 | void cbm_json_like_set_precommit_hook_for_testing(cbm_json_like_precommit_test_hook_t hook, |
no test coverage detected