Background
PR #303 (closes #296) added comprehensive tracing instrumentation to the inline-wrapping token- and fragment-classification pipeline, including #[traced_test] event-emission tests and a proptest for UTF-8 safety.
The Testing (Compile-Time / Ui) check from the PR review identified one remaining gap: no insta snapshot tests assert the stable structure of the emitted tracing events (field names, message strings, level) for the token, fragment, and footnote classification paths.
Required work
Add snapshot tests (using insta) that capture and assert the structured output of at least the following tracing call sites:
- Fragment classification (
fragment classified debug event in src/wrap/inline/fragment.rs)
- Footnote reference parsing (
footnote reference parsed debug event in src/wrap/tokenize/parsing.rs)
- Link/image parsing (
link or image parsed trace event in src/wrap/tokenize/parsing.rs)
- Span promotion (
token_span trace events in src/wrap/inline/token_span.rs)
The snapshots should assert at minimum the event message string and the structured field names (token, kind, start, end, width) so that accidental removal of instrumentation is caught at review time.
Constraints
- Do not install a global tracing subscriber in library code.
- Use
#[traced_test] (already a dev-dependency) combined with insta's assert_snapshot! for capture.
- Snapshots must be committed to the repository under
snapshots/.
References
Background
PR #303 (closes #296) added comprehensive tracing instrumentation to the inline-wrapping token- and fragment-classification pipeline, including
#[traced_test]event-emission tests and a proptest for UTF-8 safety.The Testing (Compile-Time / Ui) check from the PR review identified one remaining gap: no insta snapshot tests assert the stable structure of the emitted tracing events (field names, message strings, level) for the token, fragment, and footnote classification paths.
Required work
Add snapshot tests (using
insta) that capture and assert the structured output of at least the following tracing call sites:fragment classifieddebug event insrc/wrap/inline/fragment.rs)footnote reference parseddebug event insrc/wrap/tokenize/parsing.rs)link or image parsedtrace event insrc/wrap/tokenize/parsing.rs)token_spantrace events insrc/wrap/inline/token_span.rs)The snapshots should assert at minimum the event message string and the structured field names (
token,kind,start,end,width) so that accidental removal of instrumentation is caught at review time.Constraints
#[traced_test](already a dev-dependency) combined with insta'sassert_snapshot!for capture.snapshots/.References