diff options
Diffstat (limited to 'src/unit')
-rw-r--r-- | src/unit/fstring.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/unit/fstring.cpp b/src/unit/fstring.cpp index 462ce5e..2044a86 100644 --- a/src/unit/fstring.cpp +++ b/src/unit/fstring.cpp | |||
@@ -10,6 +10,7 @@ public: | |||
10 | addTest( Unit::compare1 ); | 10 | addTest( Unit::compare1 ); |
11 | addTest( Unit::compare2 ); | 11 | addTest( Unit::compare2 ); |
12 | addTest( Unit::appendSingle ); | 12 | addTest( Unit::appendSingle ); |
13 | addTest( Unit::shared1 ); | ||
13 | } | 14 | } |
14 | 15 | ||
15 | virtual ~Unit() | 16 | virtual ~Unit() |
@@ -36,6 +37,18 @@ public: | |||
36 | for( char l = 'a'; l < 'g'; l++ ) | 37 | for( char l = 'a'; l < 'g'; l++ ) |
37 | b += l; | 38 | b += l; |
38 | unitTest( b == "abcdef" ); | 39 | unitTest( b == "abcdef" ); |
40 | unitTest( strcmp( b.getStr(), "abcdef" ) == 0 ); | ||
41 | } | ||
42 | |||
43 | void shared1() | ||
44 | { | ||
45 | Bu::FString a("Hey there"); | ||
46 | Bu::FString b( a ); | ||
47 | unitTest( a.getStr() == b.getStr() ); | ||
48 | b += " guy"; | ||
49 | unitTest( a.getStr() != b.getStr() ); | ||
50 | a = b; | ||
51 | unitTest( a.getStr() == b.getStr() ); | ||
39 | } | 52 | } |
40 | }; | 53 | }; |
41 | 54 | ||