Skip to content

Commit 35c25e6

Browse files
committed
Add unit test of help_formatter
Modelled after help_entry's unit test.
1 parent f40203a commit 35c25e6

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

unit/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ SRC += analyses/ai/ai.cpp \
144144
util/format_number_range.cpp \
145145
util/get_base_name.cpp \
146146
util/graph.cpp \
147+
util/help_formatter.cpp \
147148
util/interval/add.cpp \
148149
util/interval/bitwise.cpp \
149150
util/interval/comparisons.cpp \

unit/util/help_formatter.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/******************************************************************\
2+
3+
Module: help formatter unit tests
4+
5+
Author: Michael Tautschnig
6+
7+
\******************************************************************/
8+
9+
#include <util/help_formatter.h>
10+
11+
#include <testing-utils/use_catch.h>
12+
13+
#include <sstream>
14+
15+
TEST_CASE("help_formatter", "[core][util]")
16+
{
17+
std::ostringstream oss;
18+
oss.clear();
19+
oss << help_formatter("--abc \t xyz\n");
20+
REQUIRE(oss.str() == "--abc xyz\n");
21+
}

0 commit comments

Comments
 (0)