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

nlohmann / json / 45132064176
100%

Build:
DEFAULT BRANCH: develop
Ran 23 Nov 2026 09:37AM UTC
Jobs 1
Files 62
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

23 Nov 2026 07:34AM UTC coverage: 99.731% (+0.001%) from 99.73%
45132064176

push

github

web-flow
Cut long tokens in parse error messages at UTF-8 character boundaries (#6136)

* Cut long tokens in parse error messages at UTF-8 character boundaries

A parse error message shows a token of more than 8192 bytes by its
first and its last 4096 bytes around "...". The cuts were at fixed byte
offsets, so they could split a UTF-8 character: for valid UTF-8 input,
what() and the last token passed to SAX parse_error() were not valid
UTF-8, and storing the message in a json value and dumping it threw
type_error.316.

Move the end of the first part back and the start of the last part
forward to a character boundary, by at most three bytes each. The
lexer always reads bytes (wide strings are converted to UTF-8 first),
and the decision depends only on bytes inside the two parts, so the
message stays the same for every kind of input. Both parts only get
shorter, so the buffers that keep the token need no more room.

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

* Name the UTF-8 cut helpers after what they do to the buffer

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

* Ignore the dump() result in the long-token test explicitly

GCC rejects the discarded nodiscard result with -Werror=unused-result.

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

---------

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

37114 of 122973 branches covered (30.18%)

24 of 24 new or added lines in 1 file covered. (100.0%)

17401 of 17448 relevant lines covered (99.73%)

4697702.89 hits per line

Jobs
ID Job ID Ran Files Coverage
1 45132064176.1 23 Nov 2026 09:37AM UTC 62
99.73
GitHub Action Run
Source Files on build 45132064176
  • Tree
  • List 62
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #45132064176
  • 32206382 on github
  • Prev Build on develop (#44918020692)
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