MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ranges_total_span

Function ranges_total_span

tests/test_parse_coverage.c:683–697  ·  view source on GitHub ↗

Total lines covered by every range in the string. */

Source from the content-addressed store, hash-verified

681
682/* Total lines covered by every range in the string. */
683static unsigned int ranges_total_span(const char *ranges) {
684 const char *p = ranges;
685 unsigned int total = 0;
686 while (p && *p) {
687 unsigned int s = 0, e = 0;
688 if (sscanf(p, "%u-%u", &s, &e) == 2 && e >= s) {
689 total += e - s + 1;
690 }
691 p = strchr(p, ',');
692 if (p) {
693 p++;
694 }
695 }
696 return total;
697}
698
699TEST(c_ifdef_split_range_narrows_to_dropped_branch) {
700 /* RED before the refinement: the raw range covers the whole 5-11

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected