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

antonvw / wex / 20437403299

22 Dec 2025 04:11PM UTC coverage: 64.322% (-0.06%) from 64.384%
20437403299

push

github

antonvw
fixed compile error

18536 of 31592 branches covered (58.67%)

Branch coverage included in aggregate %.

14771 of 20190 relevant lines covered (73.16%)

1512.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

27.12
/src/factory/unified-diff.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
// Name:      unified-diff.cpp
3
// Purpose:   Implementation of class wex::factory::unified_diff
4
//            https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
5
// Author:    Anton van Wezenbeek
6
// Copyright: (c) 2024-2025 Anton van Wezenbeek
7
////////////////////////////////////////////////////////////////////////////////
8

9
#include <wex/core/log.h>
10
#include <wex/factory/unified-diff.h>
11

12
#include <algorithm>
13
#include <utility>
14

15
#include "unified-diff-parser.h"
16

17
wex::factory::unified_diff::unified_diff(std::string input)
19✔
18
  : m_input(std::move(input))
19✔
19
{
20
}
19✔
21

22
bool wex::factory::unified_diff::parse()
11✔
23
{
24
  unified_diff_parser parser(this);
11✔
25

26
  if (!parser.parse())
11✔
27
  {
28
    return false;
5✔
29
  }
30

31
  return true;
6✔
32
}
33

34
void wex::factory::unified_diff::trace(const std::string& text) const
32✔
35
{
36
  if (log::get_level() != log::level_t::DEBUG)
32!
37
  {
38
    return;
32✔
39
  }
40

41
  using boost::describe::operators::operator<<;
42

43
  std::stringstream str;
×
44
  str << "type: " << boost::describe::enum_to_string(m_type, "none") << " "
×
45
      << *this << " ranges: ";
×
46

47
  std::ranges::for_each(
×
48
    m_range,
×
49
    [this, &str](const auto& it)
×
50
    {
51
      str << std::to_string(it) << ",";
×
52
    });
×
53

54
  str << " text sizes: ";
×
55

56
  std::ranges::for_each(
×
57
    m_text,
×
58
    [this, &str](const auto& it)
×
59
    {
60
      str << it.size() << ",";
×
61
    });
×
62

63
  str << " paths: ";
×
64

65
  std::ranges::for_each(
×
66
    m_path,
×
67
    [this, &str](const auto& it)
×
68
    {
69
      str << it.string() << ",";
×
70
    });
×
71

72
  log::debug("unified_diff::" + text) << str.str();
×
73
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc