aboutsummaryrefslogtreecommitdiff
path: root/src/unit/fstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit/fstring.cpp')
-rw-r--r--src/unit/fstring.cpp38
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
95int main( int argc, char *argv[] ) 133int main( int argc, char *argv[] )