- Fixed bug #542, which sorted the countdown columns incorrectly (thanks to
  Michelle Crane).
- Duration could not parse all varieties of it's own output, which is why the
  sorting was broken, in particular negative durations and real numbers in
  durations (such as (1.2y').
- Sorting in Table::sort_compare for Table::periodAscending and
  Table::periodDescending was broken.
- Missing unit tests for countdown_compact.
- Imported Nibbler::getNumber from the Attitash project.
- Additional Duration unit tests.
- Additional Nibbler unit tests.
- Additional countdown.t unit tests.
This commit is contained in:
Paul Beckingham 2010-11-26 14:00:49 -05:00
parent c2a84c7cf6
commit 38ffa390ea
8 changed files with 311 additions and 102 deletions

View file

@ -33,13 +33,14 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (149);
UnitTest t (155);
try
{
Nibbler n;
std::string s;
int i;
double d;
// Make sure the nibbler behaves itself with trivial input.
t.diag ("Test all nibbler calls given empty input");
@ -228,6 +229,16 @@ int main (int argc, char** argv)
t.is (i, 4, " '4' : getUnsignedInt () -> '4'");
t.ok (n.depleted (), " '' : depleted () -> true");
// bool getNumber (double&);
t.diag ("Nibbler::getNumber");
n = Nibbler ("-1.234 2.3e4");
t.ok (n.getNumber (d), "'-1.234 2.3e4' : getNumber () -> true");
t.is (d, -1.234, "'-1.234 2.3e4' : getNumber () -> '-1.234'");
t.ok (n.skip (' '), " ' 2.3e4' : skip (' ') -> true");
t.ok (n.getNumber (d), " '2.3e4' : getNumber () -> true");
t.is (d, 2.3e4, " '2.3e4' : getNumber () -> '2.3e4'");
t.ok (n.depleted (), " '' : depleted () -> true");
// bool getLiteral (const std::string&);
t.diag ("Nibbler::getLiteral");
n = Nibbler ("foobar");