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

antonvw / wex / 19781603986

28 Nov 2025 05:41PM UTC coverage: 64.369% (-0.03%) from 64.402%
19781603986

push

github

web-flow
added diff type to unified_diff (#1095)

* added diff type to unified_diff

* improved handling last of diffs

* fixed tests

18549 of 31585 branches covered (58.73%)

Branch coverage included in aggregate %.

14719 of 20098 relevant lines covered (73.24%)

1523.37 hits per line

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

45.24
/src/vcs/unified-diff.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
// Name:      unified-diff.cpp
3
// Purpose:   Implementation of class wex::unified_diff
4
//            https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
5
// Author:    Anton van Wezenbeek
6
// Copyright: (c) 2024 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(
1✔
16
  const path&      p,
17
  const vcs_entry* e,
18
  factory::frame*  f)
1✔
19
  : factory::unified_diff(e->std_out())
1✔
20
  , m_path_vcs(p)
1✔
21
  , m_frame(f)
1✔
22
  , m_path_toplevel(vcs().toplevel())
1✔
23
  , m_vcs_entry(e)
1✔
24
{
25
  m_frame->page_save();
1✔
26
}
1✔
27

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

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

40
    if (!m_frame->vcs_unified_diff(m_vcs_entry, this))
×
41
    {
42
      return false;
×
43
    }
44
  }
45

46
  return true;
×
47
}
48

49
void wex::unified_diff::report_diff_finish()
1✔
50
{
51
  m_frame->vcs_unified_diff(m_vcs_entry, this);
1✔
52
  m_frame->page_restore();
1✔
53
}
1✔
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