From 7ddeaa42e452a85e275649efa519fe0959210d12 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 11 Sep 2008 21:09:31 +0000 Subject: Fixed some whacky old FBasicString hikinx. Basically it supports all the basic, expected operators now, like plus. It was annoying without them. --- src/unit/fstring.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/unit') diff --git a/src/unit/fstring.cpp b/src/unit/fstring.cpp index c856b05..ea3342a 100644 --- a/src/unit/fstring.cpp +++ b/src/unit/fstring.cpp @@ -20,6 +20,10 @@ public: addTest( Unit::shared1 ); addTest( Unit::insert ); addTest( Unit::remove ); + addTest( Unit::add1 ); + addTest( Unit::add2 ); + addTest( Unit::add3 ); + addTest( Unit::add4 ); } virtual ~Unit() @@ -90,6 +94,40 @@ public: a.remove( 5, 1 ); unitTest( a = "abcdeghijklmnop" ); } + + void add1() + { + Bu::FString a("hi there"); + Bu::FString b(", yeah!"); + Bu::FString c = a + b; + + unitTest( c == "hi there, yeah!" ); + } + + void add2() + { + Bu::FString a("hi there"); + Bu::FString c = a + ", yeah!"; + + unitTest( c == "hi there, yeah!" ); + } + + void add3() + { + Bu::FString a("hi there"); + Bu::FString b(", yeah!"); + Bu::FString c = a + ", Mr. Man" + b; + + unitTest( c == "hi there, Mr. Man, yeah!" ); + } + + void add4() + { + Bu::FString b(", yeah!"); + Bu::FString c = "hi there" + b; + + unitTest( c == "hi there, yeah!" ); + } }; int main( int argc, char *argv[] ) -- cgit v1.2.3