| 93 | } |
| 94 | |
| 95 | bool tir_path(tir_context *c, tir_json *object, tir_bytes file) { |
| 96 | bool utf8 = tir_utf8(c, file); |
| 97 | if (c->status != CBM_TEST_RESULT_OK) |
| 98 | return false; |
| 99 | tir_json *text = file.length && utf8 ? tir_string(c, file) : tir_null(c); |
| 100 | tir_json *hex = file.length && !utf8 ? tir_hex(c, file.data, file.length) : tir_null(c); |
| 101 | return tir_add(c, object, "file", text) && tir_add(c, object, "file_hex", hex); |
| 102 | } |
| 103 | |
| 104 | tir_json *tir_digest(tir_context *c, cbm_test_result_digest_t digest) { |
| 105 | return digest.present ? tir_hex(c, digest.bytes, 32) : tir_null(c); |
no test coverage detected