mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Added unit tests for Nibbler::getNumber when the input is simply "2.0".
This commit is contained in:
parent
2274be16d8
commit
47ae2ee9f6
1 changed files with 6 additions and 1 deletions
|
@ -34,7 +34,7 @@ Context context;
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int main (int argc, char** argv)
|
int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
UnitTest t (289);
|
UnitTest t (292);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -266,6 +266,11 @@ int main (int argc, char** argv)
|
||||||
t.is (d, 2.3e4, " '2.3e4' : getNumber () -> '2.3e4'");
|
t.is (d, 2.3e4, " '2.3e4' : getNumber () -> '2.3e4'");
|
||||||
t.ok (n.depleted (), " '' : depleted () -> true");
|
t.ok (n.depleted (), " '' : depleted () -> true");
|
||||||
|
|
||||||
|
n = Nibbler ("2.0");
|
||||||
|
t.ok (n.getNumber (d), "'2.0' : getNumber () -> true");
|
||||||
|
t.is (d, 2.0, 0.000001, "'2.0' : getNumber () -> '2.0'");
|
||||||
|
t.ok (n.depleted (), " '' : depleted () -> true");
|
||||||
|
|
||||||
// bool getLiteral (const std::string&);
|
// bool getLiteral (const std::string&);
|
||||||
t.diag ("Nibbler::getLiteral");
|
t.diag ("Nibbler::getLiteral");
|
||||||
n = Nibbler ("foobar");
|
n = Nibbler ("foobar");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue