diff options
Diffstat (limited to 'src/unit/array.unit')
-rw-r--r-- | src/unit/array.unit | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/unit/array.unit b/src/unit/array.unit index 1493033..f3fdeda 100644 --- a/src/unit/array.unit +++ b/src/unit/array.unit | |||
@@ -9,6 +9,9 @@ | |||
9 | #include "bu/hash.h" | 9 | #include "bu/hash.h" |
10 | #include "bu/array.h" | 10 | #include "bu/array.h" |
11 | 11 | ||
12 | #include "bu/sio.h" | ||
13 | using Bu::sio; | ||
14 | |||
12 | suite Array | 15 | suite Array |
13 | { | 16 | { |
14 | test general | 17 | test general |
@@ -82,4 +85,20 @@ suite Array | |||
82 | unitTest( a3[1].get("Test") == "Bloop" ); | 85 | unitTest( a3[1].get("Test") == "Bloop" ); |
83 | unitTest( a3[1].get("Foo") == "ooF" ); | 86 | unitTest( a3[1].get("Foo") == "ooF" ); |
84 | } | 87 | } |
88 | |||
89 | test insert | ||
90 | { | ||
91 | Bu::Array<int> aInts; | ||
92 | aInts.insert( aInts.end(), 4 ); | ||
93 | aInts.insert( aInts.begin(), 1 ); | ||
94 | aInts.insert( aInts.end(), 5 ); | ||
95 | aInts.insert( aInts.begin()+1, 3 ); | ||
96 | aInts.insert( aInts.begin()+1, 2 ); | ||
97 | aInts.insert( aInts.begin(), 0 ); | ||
98 | |||
99 | for( int j = 0; j < 6; j++ ) | ||
100 | { | ||
101 | unitTest( aInts[j] == j ); | ||
102 | } | ||
103 | } | ||
85 | } | 104 | } |