@@ -46,30 +46,6 @@ TEST_CASE("double_to_buffer 3.141", "[NoDB]")
4646 REQUIRE (std::strcmp (buffer.c_str (), " 3.141" ) == 0 );
4747}
4848
49- TEST_CASE (" string_id_list_t with one element" , " [NoDB]" )
50- {
51- util::string_id_list_t list;
52- REQUIRE (list.empty ());
53-
54- list.add (17 );
55-
56- REQUIRE_FALSE (list.empty ());
57- REQUIRE (list.get () == " {17}" );
58- }
59-
60- TEST_CASE (" string_id_list_t with several elements" , " [NoDB]" )
61- {
62- util::string_id_list_t list;
63- REQUIRE (list.empty ());
64-
65- list.add (17 );
66- list.add (3 );
67- list.add (99 );
68-
69- REQUIRE_FALSE (list.empty ());
70- REQUIRE (list.get () == " {17,3,99}" );
71- }
72-
7349TEST_CASE (" human readable time durations" , " [NoDB]" )
7450{
7551 REQUIRE (util::human_readable_duration (0 ) == " 0s" );
@@ -116,28 +92,45 @@ TEST_CASE("find_by_name()", "[NoDB]")
11692TEST_CASE (" Use string_joiner_t with delim only without items" , " [NoDB]" )
11793{
11894 util::string_joiner_t joiner{' ,' };
95+ REQUIRE (joiner.empty ());
11996 REQUIRE (joiner ().empty ());
12097}
12198
12299TEST_CASE (" Use string_joiner_t with all params without items" , " [NoDB]" )
123100{
124101 util::string_joiner_t joiner{' ,' , ' "' , ' (' , ' )' };
102+ REQUIRE (joiner.empty ());
125103 REQUIRE (joiner ().empty ());
126104}
127105
128106TEST_CASE (" Use string_joiner_t without quote char" , " [NoDB]" )
129107{
130108 util::string_joiner_t joiner{' ,' , ' \0 ' , ' (' , ' )' };
109+ REQUIRE (joiner.empty ());
131110 joiner.add (" foo" );
111+ REQUIRE_FALSE (joiner.empty ());
132112 joiner.add (" bar" );
113+ REQUIRE_FALSE (joiner.empty ());
133114 REQUIRE (joiner () == " (foo,bar)" );
134115}
135116
117+ TEST_CASE (" Use string_joiner_t with quote char" , " [NoDB]" )
118+ {
119+ util::string_joiner_t joiner{' ,' , ' -' , ' (' , ' )' };
120+ REQUIRE (joiner.empty ());
121+ joiner.add (" foo" );
122+ REQUIRE_FALSE (joiner.empty ());
123+ joiner.add (" bar" );
124+ REQUIRE_FALSE (joiner.empty ());
125+ REQUIRE (joiner () == " (-foo-,-bar-)" );
126+ }
127+
136128TEST_CASE (" string_joiner_t without before/after" , " [NoDB]" )
137129{
138130 util::string_joiner_t joiner{' ,' };
139131 joiner.add (" xxx" );
140132 joiner.add (" yyy" );
133+ REQUIRE_FALSE (joiner.empty ());
141134 REQUIRE (joiner () == " xxx,yyy" );
142135}
143136
0 commit comments