StringView_Partition for One-Off Splits
This commit is contained in:
parent
1a330b3c9b
commit
1b3d007ec2
3 changed files with 51 additions and 0 deletions
|
@ -29,8 +29,24 @@ void test_split(void)
|
|||
return;
|
||||
}
|
||||
|
||||
void test_fext(void)
|
||||
{
|
||||
const char* filepath = "database.sqlite.old";
|
||||
|
||||
StringView sourceSV = StringView_FromString(filepath);
|
||||
StringView delim = StringView_FromString(".");
|
||||
StringView split;
|
||||
|
||||
assert(StringView_LastSplit(&split, &sourceSV, delim));
|
||||
assert(StringView_Equal(split, StringView_FromString("old")));
|
||||
assert(StringView_Equal(sourceSV, StringView_FromString("database.sqlite")));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_split();
|
||||
test_fext();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue