From 3a7e620ce654004d86c5dc42af4744ae3e1492cc Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 8 Feb 2011 23:55:57 -0500 Subject: [PATCH] Unit Tests - Inherited improved text.cpp unit tests from taskd. --- test/text.t.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/text.t.cpp b/test/text.t.cpp index 23d0e4490..b4772ab4e 100644 --- a/test/text.t.cpp +++ b/test/text.t.cpp @@ -34,7 +34,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (208); + UnitTest t (213); // void wrapText (std::vector & 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 -> \\r"); + t.is (printable ("a\nb"), "a\\nb", "printable -> \\n"); + t.is (printable ("a\fb"), "a\\fb", "printable -> \\f"); + t.is (printable ("a\tb"), "a\\tb", "printable -> \\t"); + t.is (printable ("a\vb"), "a\\vb", "printable -> \\v"); + return 0; }