Skip to content

Commit

Permalink
Indent section names
Browse files Browse the repository at this point in the history
Closes #1556
  • Loading branch information
bertwesarg committed Apr 14, 2022
1 parent 62fd660 commit 50e725d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions include/reporters/catch_reporter_console.cpp
Expand Up @@ -547,8 +547,8 @@ void ConsoleReporter::printTestCaseAndSectionHeader() {
auto
it = m_sectionStack.begin() + 1, // Skip first section (test case)
itEnd = m_sectionStack.end();
for (; it != itEnd; ++it)
printHeaderString(it->name, 2);
for (size_t indent = 2; it != itEnd; ++it, indent += 2)
printHeaderString(it->name, indent);
}

SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
Expand Down
8 changes: 4 additions & 4 deletions projects/SelfTest/Baselines/console.std.approved.txt
Expand Up @@ -697,7 +697,7 @@ with expansion:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
A
1
1
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand All @@ -707,7 +707,7 @@ Condition.tests.cpp:<line number>: FAILED:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
A
2
2
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand All @@ -717,7 +717,7 @@ Condition.tests.cpp:<line number>: FAILED:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
B
1
1
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand All @@ -727,7 +727,7 @@ Condition.tests.cpp:<line number>: FAILED:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
B
2
2
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand Down
8 changes: 4 additions & 4 deletions projects/SelfTest/Baselines/console.sw.approved.txt
Expand Up @@ -6498,7 +6498,7 @@ with expansion:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
A
1
1
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand All @@ -6508,7 +6508,7 @@ Condition.tests.cpp:<line number>: FAILED:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
A
2
2
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand All @@ -6518,7 +6518,7 @@ Condition.tests.cpp:<line number>: FAILED:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
B
1
1
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand All @@ -6528,7 +6528,7 @@ Condition.tests.cpp:<line number>: FAILED:
-------------------------------------------------------------------------------
Mayfail test case with nested sections
B
2
2
-------------------------------------------------------------------------------
Condition.tests.cpp:<line number>
...............................................................................
Expand Down
4 changes: 2 additions & 2 deletions single_include/catch2/catch.hpp
Expand Up @@ -16647,8 +16647,8 @@ void ConsoleReporter::printTestCaseAndSectionHeader() {
auto
it = m_sectionStack.begin() + 1, // Skip first section (test case)
itEnd = m_sectionStack.end();
for (; it != itEnd; ++it)
printHeaderString(it->name, 2);
for (size_t indent = 2; it != itEnd; ++it, indent += 2)
printHeaderString(it->name, indent);
}

SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
Expand Down

0 comments on commit 50e725d

Please sign in to comment.