Minor Refactoring
- Added support for more type-specific checks of attribute values. - Added support for more type-specific attribute rendering. - Improved generalized methods for checking columns in a report. - Added unit tests. - Minor code cleanup. - Added secret hidden feature for internal testing.
This commit is contained in:
@@ -49,7 +49,7 @@ int convertDuration (const std::string& input)
|
||||
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (643);
|
||||
UnitTest t (644);
|
||||
|
||||
Duration d;
|
||||
|
||||
@@ -791,6 +791,10 @@ int main (int argc, char** argv)
|
||||
left -= right;
|
||||
t.is ((int)(time_t)left, 1, "3 -= 2, 3 is now 1");
|
||||
t.is ((int)(time_t)right, 2, "3 -= 2, 2 is still 2");
|
||||
|
||||
// Assorted regression tests.
|
||||
left = Duration ("-864000.00000");
|
||||
t.is ((int)(time_t)left, 864000, "-864000.00000 -> 864000");
|
||||
}
|
||||
|
||||
catch (const std::string& e) { t.diag (e); }
|
||||
|
||||
@@ -39,15 +39,15 @@ int main (int argc, char** argv)
|
||||
{
|
||||
#ifdef NIBBLER_FEATURE_DATE
|
||||
#ifdef NIBBLER_FEATURE_REGEX
|
||||
UnitTest t (296);
|
||||
UnitTest t (299);
|
||||
#else
|
||||
UnitTest t (272);
|
||||
UnitTest t (275);
|
||||
#endif
|
||||
#else
|
||||
#ifdef NIBBLER_FEATURE_REGEX
|
||||
UnitTest t (246);
|
||||
UnitTest t (249);
|
||||
#else
|
||||
UnitTest t (222);
|
||||
UnitTest t (225);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -303,6 +303,11 @@ int main (int argc, char** argv)
|
||||
t.is (d, 2.0, 0.000001, "'2.0' : getNumber () -> '2.0'");
|
||||
t.ok (n.depleted (), " '' : depleted () -> true");
|
||||
|
||||
n = Nibbler ("-864000.00000");
|
||||
t.ok (n.getNumber (d), "'-864000.00000' : getNumber () -> true");
|
||||
t.is (d, -864000.0, "'-864000.00000' : getNumber () -> -864000.0");
|
||||
t.ok (n.depleted (), " '' : depleted () -> true");
|
||||
|
||||
// bool getLiteral (const std::string&);
|
||||
t.diag ("Nibbler::getLiteral");
|
||||
n = Nibbler ("foobar");
|
||||
|
||||
Reference in New Issue
Block a user