Skip to content

Commit ad079c8

Browse files
committed
unit test trim filename
1 parent 82eb403 commit ad079c8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/viam/sdk/tests/test_log.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,15 @@ BOOST_AUTO_TEST_CASE(test_resource_filter) {
123123
BOOST_CHECK(errLogs.back().find("sensor error") != std::string::npos);
124124
}
125125

126+
BOOST_AUTO_TEST_CASE(filename_trim) {
127+
using namespace log_detail;
128+
129+
BOOST_CHECK(trim_filename("") == "");
130+
BOOST_CHECK(trim_filename("no_delim") == "no_delim");
131+
BOOST_CHECK(trim_filename("one/slash.cpp") == "one/slash.cpp");
132+
BOOST_CHECK(trim_filename("a/full/path.cpp") == "full/path.cpp");
133+
BOOST_CHECK(trim_filename("a/b/c/d.cpp") == "c/d.cpp");
134+
}
135+
126136
} // namespace sdktests
127137
} // namespace viam

0 commit comments

Comments
 (0)