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

nlohmann / json / 43733283266
100%

Build:
DEFAULT BRANCH: develop
Ran 15 Nov 2026 06:33PM 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

15 Nov 2026 04:03PM UTC coverage: 99.73% (+0.003%) from 99.727%
43733283266

push

github

web-flow
Keep only the beginning and the end of a long token for error messages (#6121)

* Keep only the beginning and the end of a long token for error messages

For "last read" in parse errors, the lexer keeps the text of the token it
reads. The token start moves only at strings and numbers, so everything
after a string or number belongs to it until the next one starts. Input
that cannot be read again copies that text while parsing (the istream and
FILE* adapters in their carry buffer, the lexer in token_string for
iterators), so valid input of 1 followed by 100,000,000 newlines peaked
at about 225 MB, and a long string was kept a second time.

Replace the carry buffer and token_string by token_text_buffer, which
keeps the first 4096 and at least the last 4112 characters of a token and
drops the characters in between where it would otherwise grow, so
appending stays as cheap as before. get_token_string() shows a token of
more than 8192 characters as its first and last 4096 characters around
"...", the same for every kind of input; contiguous input copies only
these parts.

The example input now peaks at 1.8 MB. Instruction counts of parsing
from std::string, std::istream and FILE* are unchanged (clang 21 and
GCC 15); parsing from std::list<char> needs 1 to 17 % fewer.

Fixes #6120.

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

* Suppress an Infer false positive in the token text buffer test

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

---------

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

36996 of 122960 branches covered (30.09%)

68 of 68 new or added lines in 2 files covered. (100.0%)

3 existing lines in 1 file now uncovered.

17346 of 17393 relevant lines covered (99.73%)

4430012.98 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
99.83
0.0% include/nlohmann/detail/input/binary_reader.hpp
Jobs
ID Job ID Ran Files Coverage
1 43733283266.1 15 Nov 2026 06:33PM UTC 62
99.73
GitHub Action Run
Source Files on build 43733283266
  • Tree
  • List 62
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #43733283266
  • abbc2996 on github
  • Prev Build on develop (#43708847460)
  • Next Build on develop (#44262929688)
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