From 0c05069bafefaf886febe9473c1acf978adb1053 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 8 Jan 2011 11:12:39 -0500 Subject: [PATCH] Bug #624 - Enhanced unit tests in response to bug #624 (thanks to Steve Rader). --- ChangeLog | 1 + test/duration.t.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb131a7f2..a6063faf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -73,6 +73,7 @@ + Applied patch to fix bug #618, so that the configuration setting 'edit.verbose' can be set to 'no' and eliminate the help text when using the 'task edit' command (thanks to Steve Rader). + + Enhanced unit tests in response to bug #624 (thanks to Steve Rader). ------ old releases ------------------------------ diff --git a/test/duration.t.cpp b/test/duration.t.cpp index 6faeeb8df..e6f1fbe54 100644 --- a/test/duration.t.cpp +++ b/test/duration.t.cpp @@ -48,7 +48,7 @@ int convertDuration (const std::string& input) int main (int argc, char** argv) { - UnitTest t (606); + UnitTest t (608); Duration d; @@ -627,7 +627,9 @@ int main (int argc, char** argv) t.ok (d.valid ("-1 sec"), "valid duration -1 sec"); t.ok (d.valid ("-1s"), "valid duration -1s"); - t.notok (d.valid ("woof"), "valid duration woof = fail"); + t.ok (d.valid ("-"), "valid duration -"); + + t.notok (d.valid ("woof"), "valid duration woof = fail"); t.is (convertDuration ("daily"), 1, "valid duration daily"); t.is (convertDuration ("day"), 1, "valid duration day"); @@ -695,6 +697,7 @@ int main (int argc, char** argv) t.is (convertDuration ("10 day"), 10, "valid duration 10 day"); t.is (convertDuration ("10d"), 10, "valid duration 10d"); + t.is (convertDuration ("-"), 0, "valid duration -"); try { Duration left, right;