mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-02 14:38:34 +02:00
Unit Tests - Att
- Added modifier parsing unit tests.
This commit is contained in:
parent
948380ce96
commit
9eb68881af
1 changed files with 19 additions and 1 deletions
|
@ -30,7 +30,7 @@
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int main (int argc, char** argv)
|
int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest t (37);
|
UnitTest t (42);
|
||||||
|
|
||||||
Att a1 ("name", "value");
|
Att a1 ("name", "value");
|
||||||
t.is (a1.name (), "name", "Att::Att (name, value), Att.name");
|
t.is (a1.name (), "name", "Att::Att (name, value), Att.name");
|
||||||
|
@ -164,6 +164,24 @@ int main (int argc, char** argv)
|
||||||
try {a7.parse (n);} catch (...) {good = false;}
|
try {a7.parse (n);} catch (...) {good = false;}
|
||||||
t.notok (good, "Att::parse (name\")");
|
t.notok (good, "Att::parse (name\")");
|
||||||
|
|
||||||
|
// Mods
|
||||||
|
n = Nibbler ("name.any:\"value\"");
|
||||||
|
good = true;
|
||||||
|
try {a7.parse (n);} catch (...) {good = false;}
|
||||||
|
t.ok (good, "Att::parse (name.any:\"value\")");
|
||||||
|
t.is (a7.composeF4 (), "name:\"value\"", "Att::composeF4 -> name:\"value\"");
|
||||||
|
|
||||||
|
n = Nibbler ("name.any.none:\"value\"");
|
||||||
|
good = true;
|
||||||
|
try {a7.parse (n);} catch (...) {good = false;}
|
||||||
|
t.ok (good, "Att::parse (name.any.none:\"value\")");
|
||||||
|
t.is (a7.composeF4 (), "name:\"value\"", "Att::composeF4 -> name:\"value\"");
|
||||||
|
|
||||||
|
n = Nibbler ("name.bogus:\"value\"");
|
||||||
|
good = true;
|
||||||
|
try {a7.parse (n);} catch (...) {good = false;}
|
||||||
|
t.notok (good, "Att::parse (name.bogus:\"value\")");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue