From 56837535aeb1c7ae0fa2730d77dd718c334cf729 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 18 Oct 2011 08:59:58 -0700 Subject: And so kids, this is why we have unit tests. --- tests/test-String.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/test-String.cc b/tests/test-String.cc index 8e6eacb..1f7efc0 100644 --- a/tests/test-String.cc +++ b/tests/test-String.cc @@ -27,6 +27,11 @@ void MainTask::Do() { x = y; x.do_rtrim(); Assert(x == " foo bar"); x = y; x.do_trim(); Assert(x == "foo bar"); + y = " "; + x = y; x.do_ltrim(); Assert(x == ""); + x = y; x.do_rtrim(); Assert(x == ""); + x = y; x.do_trim(); Assert(x == ""); + x = "42"; Assert(x.to_int() == 42); x = "0x42"; Assert(x.to_int() == 0x42); x = "42"; Assert(x.to_int(16) == 0x42); -- cgit v1.2.3