mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-02 23:48:35 +02:00
File Import
- Implemented all remaining import functionality.
This commit is contained in:
parent
5f4563af2f
commit
25425614b1
6 changed files with 354 additions and 22 deletions
|
@ -31,7 +31,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (78);
|
||||
UnitTest t (94);
|
||||
|
||||
// void wrapText (std::vector <std::string>& lines, const std::string& text, const int width)
|
||||
std::string text = "This is a test of the line wrapping code.";
|
||||
|
@ -183,6 +183,24 @@ int main (int argc, char** argv)
|
|||
t.is (trim (" \t xxx \t "), "\t xxx \t", "trim ' \\t xxx \\t ' -> '\\t xxx \\t'");
|
||||
t.is (trim (" \t xxx \t ", " \t"), "xxx", "trim ' \\t xxx \\t ' -> 'xxx'");
|
||||
|
||||
// std::string unquoteText (const std::string& text)
|
||||
t.is (unquoteText (""), "", "unquoteText '' -> ''");
|
||||
t.is (unquoteText ("x"), "x", "unquoteText 'x' -> 'x'");
|
||||
t.is (unquoteText ("'x"), "'x", "unquoteText ''x' -> ''x'");
|
||||
t.is (unquoteText ("x'"), "x'", "unquoteText 'x'' -> 'x''");
|
||||
t.is (unquoteText ("\"x"), "\"x", "unquoteText '\"x' -> '\"x'");
|
||||
t.is (unquoteText ("x\""), "x\"", "unquoteText 'x\"' -> 'x\"'");
|
||||
t.is (unquoteText ("''"), "", "unquoteText '''' -> ''");
|
||||
t.is (unquoteText ("'''"), "'", "unquoteText ''''' -> '''");
|
||||
t.is (unquoteText ("\"\""), "", "unquoteText '\"\"' -> ''");
|
||||
t.is (unquoteText ("\"\"\""), "\"", "unquoteText '\"\"\"' -> '\"'");
|
||||
t.is (unquoteText ("''''"), "''", "unquoteText '''''' -> ''''");
|
||||
t.is (unquoteText ("\"\"\"\""), "\"\"", "unquoteText '\"\"\"\"' -> '\"\"'");
|
||||
t.is (unquoteText ("'\"\"'"), "\"\"", "unquoteText '''\"\"' -> '\"\"'");
|
||||
t.is (unquoteText ("\"''\""), "''", "unquoteText '\"''\"' -> ''''");
|
||||
t.is (unquoteText ("'x'"), "x", "unquoteText ''x'' -> 'x'");
|
||||
t.is (unquoteText ("\"x\""), "x", "unquoteText '\"x\"' -> 'x'");
|
||||
|
||||
// std::string commify (const std::string& data)
|
||||
t.is (commify (""), "", "commify '' -> ''");
|
||||
t.is (commify ("1"), "1", "commify '1' -> '1'");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue