aboutsummaryrefslogtreecommitdiff
path: root/src/unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit')
-rw-r--r--src/unit/fstring.unit9
-rw-r--r--src/unit/hash.unit13
2 files changed, 22 insertions, 0 deletions
diff --git a/src/unit/fstring.unit b/src/unit/fstring.unit
index 00b6eed..c6d7414 100644
--- a/src/unit/fstring.unit
+++ b/src/unit/fstring.unit
@@ -339,4 +339,13 @@ suite FString
339 a = "This is a test."; 339 a = "This is a test.";
340 unitTest( a.replace("i", "ooo") == "Thooos ooos a test." ); 340 unitTest( a.replace("i", "ooo") == "Thooos ooos a test." );
341 } 341 }
342
343 test coreDerefBug1
344 {
345 Bu::FString a, b;
346 a = "bob";
347 a.setSize( 0 );
348 b = a;
349 b.getStr();
350 }
342} 351}
diff --git a/src/unit/hash.unit b/src/unit/hash.unit
index e3d7e42..124b074 100644
--- a/src/unit/hash.unit
+++ b/src/unit/hash.unit
@@ -84,4 +84,17 @@ suite Hash
84 printf(" - \"%s\" = %d\n", i.getKey().getStr(), i.getValue() ); 84 printf(" - \"%s\" = %d\n", i.getKey().getStr(), i.getValue() );
85 } */ 85 } */
86 } 86 }
87
88 test copy
89 {
90 StrIntHash h;
91 h.insert("hello", 55 );
92 h.insert("goodbye", -1812 );
93
94 StrIntHash h2 = h;
95 unitTest( h2.isCoreShared( h ) );
96
97 StrIntHash h3 = h.clone();
98 unitTest( !h3.isCoreShared( h ) );
99 }
87} 100}