mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Tests: Added ::quoteIfNeeded
This commit is contained in:
parent
ebf9234006
commit
753e05f314
1 changed files with 5 additions and 1 deletions
|
@ -31,7 +31,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int, char**)
|
||||
{
|
||||
UnitTest t (5);
|
||||
UnitTest t (7);
|
||||
|
||||
// std::string escape (const std::string& input, int c)
|
||||
t.is (escape ("", 'x'), "", "escape '','x' --> ''");
|
||||
|
@ -40,6 +40,10 @@ int main (int, char**)
|
|||
t.is (escape ("foo", 'o'), "f\\o\\o", "escape 'foo','o' --> 'f\\o\\o'");
|
||||
t.is (escape ("\"", '"'), "\\\"", "escape '\"','\"' --> '\\\"'");
|
||||
|
||||
// std::string quoteIfNeeded (const std::string& input)
|
||||
t.is (quoteIfNeeded ("foo"), "foo", "quoteIfNeeded 'foo' --> 'foo'");
|
||||
t.is (quoteIfNeeded ("f o o"), "\"f o o\"", "quoteIfNeeded 'f o o' --> '\"f o o\"'");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue