• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nlohmann / json / 40754084869
95%

Build:
DEFAULT BRANCH: develop
Ran 28 Oct 2026 07:49PM UTC
Jobs 1
Files 61
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Oct 2026 07:24PM UTC coverage: 95.049% (-0.03%) from 95.081%
40754084869

push

github

web-flow
json_view: source positions in materialize() with JSON_DIAGNOSTIC_POSITIONS (#5945)

* json_view: source positions in materialize() with JSON_DIAGNOSTIC_POSITIONS

With JSON_DIAGNOSTIC_POSITIONS, materialize() now gives every value the
start_pos()/end_pos() that basic_json::parse() would give it, so exceptions
about materialized values name the same bytes (#5864).

- json_sax_dom_parser takes the lexer type as a defaulted template
  parameter; materialize() passes position_source, which reports the
  positions it derives from the index. diagnostic_positions treats npos as
  "no position" and keeps ranges all-or-nothing.
- Strings with escapes keep the offset of their opening quote plus one in
  `next` (only with the macro); materialize() scans from there to the closing
  quote. The end of an array or object is found by scanning from the end of
  its last element over whitespace, comments and a trailing comma.
- In editable documents, values written by edits, arrays and objects whose
  elements changed, and containers whose last element has no position get
  none. Images keep the flag is_new, and load() checks that `next` of a
  string is within the text.

Nothing changes on the parse path without the macro. The view's own
exceptions still carry no byte range, so the tests that compare them with
those of materialized values skip it under the macro, as they skip the path
under JSON_DIAGNOSTICS.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Indent comment in unit-json_view_from_json.cpp

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Address review: clearer position code and docs

- position_source gets clear(); set_scalar() returns early for new values,
  switches on node_kind, and uses no local copies; the one position_source
  per materialize() call is documented
- no npos + 1 for containers without a position; a comment on why the end
  of a container is reported as its closing bracket
- less duplication under #if in materialize() and the b... (continued)

19355 of 54216 branches covered (35.7%)

126 of 137 new or added lines in 5 files covered. (91.97%)

57 existing lines in 3 files now uncovered.

14687 of 15452 relevant lines covered (95.05%)

5337420.0 hits per line

Uncovered Changes

Lines Coverage ∆ File
9
95.0
-5.0% include/nlohmann/detail/view/materialize.hpp
2
59.32
-0.76% include/nlohmann/detail/view/builder.hpp

Coverage Regressions

Lines Coverage ∆ File
30
95.73
0.03% include/nlohmann/detail/json_pointer.hpp
26
96.5
0.01% include/nlohmann/json.hpp
1
59.32
-0.76% include/nlohmann/detail/view/builder.hpp
Jobs
ID Job ID Ran Files Coverage
1 40754084869.1 28 Oct 2026 07:49PM UTC 61
95.05
GitHub Action Run
Source Files on build 40754084869
  • Tree
  • List 61
  • Changed 9
  • Source Changed 9
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40754084869
  • 54f6b3ef on github
  • Prev Build on develop (#40642330028)
  • Next Build on develop (#40769491554)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc