Cleanup branches and add more unit tests

This commit is contained in:
Antonio SJ Musumeci 2026-03-16 20:02:56 -05:00 • committed by trapexit
parent a30a4df9c0
commit 7f52623536
4 changed files with 970 additions and 15 deletions

View file

@ -82,7 +82,10 @@ namespace l
offset = s_.find_first_not_of("+<>-=");
if(offset == std::string::npos)
return;
{
*instr_ = s_.substr(0, std::min(s_.size(), (size_t)2));
return;
}
if(offset > 1)
offset = 2;
@ -293,6 +296,9 @@ namespace l
int
erase_begin(Branches::Impl *branches_)
{
if(branches_->empty())
return -ENOENT;
branches_->erase(branches_->begin());
return 0;
@ -302,6 +308,9 @@ namespace l
int
erase_end(Branches::Impl *branches_)
{
if(branches_->empty())
return -ENOENT;
branches_->pop_back();
return 0;