forked from Alepha/Alepha
Fix bug in split
, where the last item is discarded.
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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" } },
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user