TDB2 parsing

- TDB2::load_lines was splitting the text on \n, but because the last
  line contains \n, there was an additional blank line.  This is what
  split_minimal is for.
- split_minimal contained a copy/paste bug that added the extra line
  if the input was non-trivial, instead of if the remainder was non-
  trivial.
- Fixed incorrect unit test accordingly.
This commit is contained in:
Paul Beckingham 2011-08-13 23:19:11 -04:00
parent 587f2a002f
commit fb9e82ed0e
3 changed files with 4 additions and 8 deletions

View file

@ -112,7 +112,7 @@ int main (int argc, char** argv)
t.is (items[1], "", "split '-' '-' -> [1] ''");
split_minimal (items, unsplit, '-');
t.is (items.size (), (size_t) 1, "split '-' '-' -> '-'");
t.is (items.size (), (size_t) 0, "split '-' '-' ->");
unsplit = "-a-bc-def";
split (items, unsplit, '-');