mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Inherited improved text.cpp unit tests from taskd.
This commit is contained in:
parent
589c918f79
commit
3a7e620ce6
1 changed files with 8 additions and 1 deletions
|
@ -34,7 +34,7 @@ Context context;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int main (int argc, char** argv)
|
||||
{
|
||||
UnitTest t (208);
|
||||
UnitTest t (213);
|
||||
|
||||
// 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.";
|
||||
|
@ -416,6 +416,13 @@ int main (int argc, char** argv)
|
|||
|
||||
// std::string format (double, int, int);
|
||||
|
||||
// std::string printable (const std::string&);
|
||||
t.is (printable ("a\rb"), "a\\rb", "printable <carriage-return> -> \\r");
|
||||
t.is (printable ("a\nb"), "a\\nb", "printable <newline> -> \\n");
|
||||
t.is (printable ("a\fb"), "a\\fb", "printable <formfeed> -> \\f");
|
||||
t.is (printable ("a\tb"), "a\\tb", "printable <tab> -> \\t");
|
||||
t.is (printable ("a\vb"), "a\\vb", "printable <vertical-space> -> \\v");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue