Durations

- Removed support for ' 1 wk', namely spaces before and after the ordinal.
  This removes (some) ambiguity in more complex command lines.
- Fixed unit tests accordingly.
This commit is contained in:
Paul Beckingham 2011-08-21 23:19:10 -04:00
parent 501953a6da
commit 6ed2bcd605
2 changed files with 94 additions and 99 deletions

View file

@ -338,9 +338,7 @@ bool Duration::valid (const std::string& input)
// Assume the ordinal is 1, but look for an integer, just in case.
double value = 1;
Nibbler n (lower_input);
n.skipAll (' ');
n.getNumber (value);
n.skipAll (' ');
if (value < 0.0)
value = -value;
@ -377,11 +375,8 @@ void Duration::parse (const std::string& input)
// Assume the ordinal is 1, but look for an integer, just in case.
double value = 1;
Nibbler n (lower_input);
n.skipAll (' ');
n.getNumber (value);
n.skipAll (' ');
if (value < 0.0)
{
mNegative = true;