CCSDS Space Data Link Security (355.0-B-2)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

csvt: use Textloc.Error.t natively with Path/Sort context

Same refactor pattern as xmlt (d786b041, 067b745c):

- Dropped the custom error ADT (Missing_header, Missing_column,
Bad_value, Truncated_row, Encode_error, Invalid_utf8), error_to_string,
pp_error.
- module Error = Textloc.Error (re-exports shared infrastructure).
- module Sort = Row | Field | Header with to_string, pp, kinded,
or_kind.
- Internal helpers raise Textloc.Error.msgf/msg; try/with at boundaries.
- decode/decode_string/decode_channel/decode_file/fold_channel/fold_file
now return (_, string) result.
- Added primed variants returning (_, Error.t) result.
- Path threading: push_array for row index, push_object for column
name -- errors carry structural context.
- Added ?max_rows / ?max_cols limits on decode.
- Kept Invalid_utf8_encode of int exception.

Tests tightened to STRUCTURAL assertions (exact frames list, exact
message) instead of substring checks.

Same tightening retrofitted to xmlt's context tests -- 12 tests
now assert exact Textloc.Error.t shape (full frame list including
outer-first ordering, exact message) rather than 'contains'.

Downstream fixes: ocaml-cdm collapses its typed error ADT to
[Parse_error of string]; 38 interop test files updated from
[Alcotest.failf "%a" Csvt.pp_error e] to ["%s" e].

csvt: 60 tests pass. xmlt: 177 tests pass.

+2 -2
+2 -2
test/interop/cryptolib/test.ml
··· 80 80 let load_vectors () = 81 81 match Csvt.decode_file vector_codec (trace "vectors.csv") with 82 82 | Ok rows -> rows 83 - | Error e -> Alcotest.failf "CSV parse: %a" Csvt.pp_error e 83 + | Error e -> Alcotest.failf "CSV parse: %s" e 84 84 85 85 (* {1 SA / key setup} *) 86 86 ··· 207 207 let load_fsr_vectors () = 208 208 match Csvt.decode_file fsr_codec (trace "fsr.csv") with 209 209 | Ok rows -> rows 210 - | Error e -> Alcotest.failf "fsr.csv: %a" Csvt.pp_error e 210 + | Error e -> Alcotest.failf "fsr.csv: %s" e 211 211 212 212 let test_fsr_decode (r : fsr_row) () = 213 213 let word = Int32.of_string ("0x" ^ r.fsr_hex) in