diff --git a/string_algorithms.cpp b/string_algorithms.cpp index e80b016..8befb00 100644 --- a/string_algorithms.cpp +++ b/string_algorithms.cpp @@ -219,6 +219,7 @@ namespace Alepha::Cavorite ::detail:: string_algorithms rv.push_back( std::move( next ) ); next.clear(); } + rv.push_back( std::move( next ) ); return rv; } } diff --git a/string_algorithms.test/0.cc b/string_algorithms.test/0.cc index c3494c1..55c1329 100644 --- a/string_algorithms.test/0.cc +++ b/string_algorithms.test/0.cc @@ -47,4 +47,11 @@ static auto init= enroll <=[] } catch( ... ) {} }; + + "Does the `split` function handle simple cases correctly?"_test <=TableTest< Alepha::split >::Cases + { + { "Empty string", { "", ':' }, { "" } }, + { "Single token", { "item", ':' }, { "item" } }, + { "Two tokens", { "first:second", ':' }, { "first", "second" } }, + }; };