diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fstring.h | 7 | ||||
-rw-r--r-- | src/unit/fstring.cpp | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/fstring.h b/src/fstring.h index 91251bc..5c70919 100644 --- a/src/fstring.h +++ b/src/fstring.h | |||
@@ -516,6 +516,13 @@ namespace Bu | |||
516 | return ret; | 516 | return ret; |
517 | } | 517 | } |
518 | 518 | ||
519 | MyType operator +( chr *pRight ) | ||
520 | { | ||
521 | MyType ret( *this ); | ||
522 | ret.append( pRight ); | ||
523 | return ret; | ||
524 | } | ||
525 | |||
519 | /** | 526 | /** |
520 | * Reset your FString to this character array. | 527 | * Reset your FString to this character array. |
521 | *@param pData (const chr *) The character array to set your FString to. | 528 | *@param pData (const chr *) The character array to set your FString to. |
diff --git a/src/unit/fstring.cpp b/src/unit/fstring.cpp index 7be03a7..9430a83 100644 --- a/src/unit/fstring.cpp +++ b/src/unit/fstring.cpp | |||
@@ -8,6 +8,8 @@ | |||
8 | #include "bu/fstring.h" | 8 | #include "bu/fstring.h" |
9 | #include "bu/unitsuite.h" | 9 | #include "bu/unitsuite.h" |
10 | 10 | ||
11 | #include <dirent.h> | ||
12 | |||
11 | class Unit : public Bu::UnitSuite | 13 | class Unit : public Bu::UnitSuite |
12 | { | 14 | { |
13 | public: | 15 | public: |
@@ -25,6 +27,7 @@ public: | |||
25 | addTest( Unit::add3 ); | 27 | addTest( Unit::add3 ); |
26 | addTest( Unit::add4 ); | 28 | addTest( Unit::add4 ); |
27 | addTest( Unit::add5 ); | 29 | addTest( Unit::add5 ); |
30 | addTest( Unit::add6 ); | ||
28 | addTest( Unit::subStr1 ); | 31 | addTest( Unit::subStr1 ); |
29 | } | 32 | } |
30 | 33 | ||
@@ -140,6 +143,15 @@ public: | |||
140 | unitTest( b == "hey, sup?" ); | 143 | unitTest( b == "hey, sup?" ); |
141 | } | 144 | } |
142 | 145 | ||
146 | void add6() | ||
147 | { | ||
148 | Bu::FString a("Hello"); | ||
149 | char b[256] = {"Dude"}; | ||
150 | Bu::FString c = a + "/" + b; | ||
151 | |||
152 | unitTest( c == "Hello/Dude" ); | ||
153 | } | ||
154 | |||
143 | void subStr1() | 155 | void subStr1() |
144 | { | 156 | { |
145 | Bu::FString a("abcdefghijklmnop"); | 157 | Bu::FString a("abcdefghijklmnop"); |