Unit Tests

- Fixed bug in Nibbler::getN.
- Added unit test for Nibbler::getN.
This commit is contained in:
Paul Beckingham 2011-07-31 11:14:56 -04:00
parent 01d3da90ae
commit c244132476
2 changed files with 13 additions and 2 deletions

View file

@ -219,7 +219,7 @@ bool Nibbler::getUntilEOS (std::string& result)
////////////////////////////////////////////////////////////////////////////////
bool Nibbler::getN (const int quantity, std::string& result)
{
if (mCursor + quantity < mLength)
if (mCursor + quantity <= mLength)
{
result = mInput.substr (mCursor, quantity);
mCursor += quantity;