mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Code Cleanup
- Migrated format helper functions over from taskd. - Converted much of the sprintf usage to format calls.
This commit is contained in:
parent
5f007ed1d9
commit
a6cf99a83c
12 changed files with 138 additions and 47 deletions
|
@ -33,7 +33,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (155);
|
||||
UnitTest t (162);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -54,6 +54,7 @@ int main (int argc, char** argv)
|
|||
t.notok (n.skipAllOneOf ("abc"), "trivial: skipAllOneOf");
|
||||
t.notok (n.getQuoted ('"', s), "trivial: getQuoted");
|
||||
t.notok (n.getInt (i), "trivial: getInt");
|
||||
t.notok (n.getHex (i), "trivial: getHex");
|
||||
t.notok (n.getUnsignedInt (i), "trivial: getUnsignedInt");
|
||||
t.notok (n.getUntilEOL (s), "trivial: getUntilEOL");
|
||||
t.notok (n.getUntilEOS (s), "trivial: getUntilEOS");
|
||||
|
@ -219,6 +220,16 @@ int main (int argc, char** argv)
|
|||
t.is (i, -4, " '-4' : getInt () -> '-4'");
|
||||
t.ok (n.depleted (), " '' : depleted () -> true");
|
||||
|
||||
// bool getHex (int&);
|
||||
t.diag ("Nibbler::getHex");
|
||||
n = Nibbler ("123 7b");
|
||||
t.ok (n.getHex (i), " '123 7b' : getHex () -> true");
|
||||
t.is (i, 291, " '123 7b' : getHex () -> '291'");
|
||||
t.ok (n.skip (' '), " ' 7b' : skip (' ') -> true");
|
||||
t.ok (n.getHex (i), " '7b' : getHex () -> true");
|
||||
t.is (i, 123, " '7b' : getHex () -> '123'");
|
||||
t.ok (n.depleted (), " '' : depleted () -> true");
|
||||
|
||||
// bool getUnsignedInt (int&i);
|
||||
t.diag ("Nibbler::getUnsignedInt");
|
||||
n = Nibbler ("123 4");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue