@@ -140,20 +140,14 @@ make_capture_buffer(const capture_state& captures) noexcept {
140140}
141141} // namespace
142142
143- std::string_view
144- make_full_name (small_string<max_test_name_length>& buffer, const test_id& id) noexcept {
143+ bool make_full_name (small_string<max_test_name_length>& buffer, const test_id& id) noexcept {
145144 buffer.clear ();
145+
146146 if (id.type .length () != 0 ) {
147- if (!append (buffer, id.name , " <" , id.type , " >" )) {
148- return {};
149- }
147+ return append (buffer, id.name , " <" , id.type , " >" );
150148 } else {
151- if (!append (buffer, id.name )) {
152- return {};
153- }
149+ return append (buffer, id.name );
154150 }
155-
156- return buffer.str ();
157151}
158152} // namespace snitch::impl
159153
@@ -363,7 +357,7 @@ registry::add_impl(const test_id& id, const source_location& location, impl::tes
363357 test_list.push_back (impl::test_case{id, location, func});
364358
365359 small_string<max_test_name_length> buffer;
366- if (impl::make_full_name (buffer, test_list.back ().id ). empty ( )) {
360+ if (! impl::make_full_name (buffer, test_list.back ().id )) {
367361 using namespace snitch ::impl;
368362 print (
369363 make_colored (" error:" , with_color, color::fail),
@@ -849,8 +843,9 @@ bool run_tests_impl(registry& r, const cli::input& args) noexcept {
849843
850844 // Evaluate each filter (provided as separate command-line argument).
851845 for (const auto & filter : filter_strings) {
852- const filter_result sub_result =
853- is_filter_match_id (impl::make_full_name (buffer, id), id.tags , filter);
846+ impl::make_full_name (buffer, id);
847+
848+ const filter_result sub_result = is_filter_match_id (buffer.str (), id.tags , filter);
854849
855850 if (!result.has_value ()) {
856851 // The first filter initialises the result.
0 commit comments