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

antonvw / wex / 25395094560

05 May 2026 06:35PM UTC coverage: 64.771% (+0.03%) from 64.741%
25395094560

push

github

antonvw
fixed test, and update vcs_entry for toplevel

18930 of 32086 branches covered (59.0%)

Branch coverage included in aggregate %.

15096 of 20447 relevant lines covered (73.83%)

1456.29 hits per line

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

65.96
/src/vcs/unified-diff.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
// Name:      unified-diff.cpp
3
// Purpose:   Implementation of class wex::unified_diff (for git)
4
//            https://git-scm.com/docs/diff-format
5
// Author:    Anton van Wezenbeek
6
// Copyright: (c) 2024-2026 Anton van Wezenbeek
7
////////////////////////////////////////////////////////////////////////////////
8

9
#include <wex/core/log.h>
10
#include <wex/factory/frame.h>
11
#include <wex/vcs/unified-diff.h>
12
#include <wex/vcs/vcs-entry.h>
13
#include <wex/vcs/vcs.h>
14

15
wex::unified_diff::unified_diff(
2✔
16
  const path&      p,
17
  const vcs_entry* e,
18
  factory::frame*  f)
2✔
19
  : factory::unified_diff(e->std_out(), f)
2✔
20
  , m_path_vcs(p)
2✔
21
  , m_frame(f)
2✔
22
  , m_path_toplevel(path(e->get_toplevel()))
2✔
23
  , m_vcs_entry(e)
2✔
24
{
25
}
2✔
26

27
bool wex::unified_diff::report_diff()
1✔
28
{
29
  m_path_vcs = path(m_path_toplevel).append(m_path[0]);
1✔
30

31
  if (!m_path_vcs.dir_exists())
1!
32
  {
33
    if (!m_path_vcs.file_exists())
1!
34
    {
35
      log("unified_diff") << m_path_vcs.string()
×
36
                          << "with toplevel:" << m_path_toplevel.string()
×
37
                          << "does not exist";
×
38
      return false;
×
39
    }
40

41
    if (!m_frame->report_unified_diff(this))
1!
42
    {
43
      return false;
1✔
44
    }
45
  }
46

47
  return true;
×
48
}
49

50
std::string wex::unified_diff::token_from() const
2✔
51
{
52
  return "a/";
4✔
53
}
54

55
std::string wex::unified_diff::token_to() const
2✔
56
{
57
  return "b/";
4✔
58
}
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