diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-09-11 21:09:31 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-09-11 21:09:31 +0000 |
commit | 7ddeaa42e452a85e275649efa519fe0959210d12 (patch) | |
tree | ee83a1a5b8855d11855698ccd68b19241b3ec40d /src/unit/fstring.cpp | |
parent | 5dbc8f155b16759b4ebb82aceb3759c686489e3b (diff) | |
download | libbu++-7ddeaa42e452a85e275649efa519fe0959210d12.tar.gz libbu++-7ddeaa42e452a85e275649efa519fe0959210d12.tar.bz2 libbu++-7ddeaa42e452a85e275649efa519fe0959210d12.tar.xz libbu++-7ddeaa42e452a85e275649efa519fe0959210d12.zip |
Fixed some whacky old FBasicString hikinx. Basically it supports all the basic,
expected operators now, like plus. It was annoying without them.
Diffstat (limited to '')
-rw-r--r-- | src/unit/fstring.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
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: | |||
20 | addTest( Unit::shared1 ); | 20 | addTest( Unit::shared1 ); |
21 | addTest( Unit::insert ); | 21 | addTest( Unit::insert ); |
22 | addTest( Unit::remove ); | 22 | addTest( Unit::remove ); |
23 | addTest( Unit::add1 ); | ||
24 | addTest( Unit::add2 ); | ||
25 | addTest( Unit::add3 ); | ||
26 | addTest( Unit::add4 ); | ||
23 | } | 27 | } |
24 | 28 | ||
25 | virtual ~Unit() | 29 | virtual ~Unit() |
@@ -90,6 +94,40 @@ public: | |||
90 | a.remove( 5, 1 ); | 94 | a.remove( 5, 1 ); |
91 | unitTest( a = "abcdeghijklmnop" ); | 95 | unitTest( a = "abcdeghijklmnop" ); |
92 | } | 96 | } |
97 | |||
98 | void add1() | ||
99 | { | ||
100 | Bu::FString a("hi there"); | ||
101 | Bu::FString b(", yeah!"); | ||
102 | Bu::FString c = a + b; | ||
103 | |||
104 | unitTest( c == "hi there, yeah!" ); | ||
105 | } | ||
106 | |||
107 | void add2() | ||
108 | { | ||
109 | Bu::FString a("hi there"); | ||
110 | Bu::FString c = a + ", yeah!"; | ||
111 | |||
112 | unitTest( c == "hi there, yeah!" ); | ||
113 | } | ||
114 | |||
115 | void add3() | ||
116 | { | ||
117 | Bu::FString a("hi there"); | ||
118 | Bu::FString b(", yeah!"); | ||
119 | Bu::FString c = a + ", Mr. Man" + b; | ||
120 | |||
121 | unitTest( c == "hi there, Mr. Man, yeah!" ); | ||
122 | } | ||
123 | |||
124 | void add4() | ||
125 | { | ||
126 | Bu::FString b(", yeah!"); | ||
127 | Bu::FString c = "hi there" + b; | ||
128 | |||
129 | unitTest( c == "hi there, yeah!" ); | ||
130 | } | ||
93 | }; | 131 | }; |
94 | 132 | ||
95 | int main( int argc, char *argv[] ) | 133 | int main( int argc, char *argv[] ) |