From b1522d279d22725a731cb8db93ec2d077028374c Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 26 May 2010 05:35:02 +0000 Subject: More tweaks and informational functions. --- src/unit/array.unit | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/unit/array.unit') 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 @@ #include "bu/hash.h" #include "bu/array.h" +#include "bu/sio.h" +using Bu::sio; + suite Array { test general @@ -82,4 +85,20 @@ suite Array unitTest( a3[1].get("Test") == "Bloop" ); unitTest( a3[1].get("Foo") == "ooF" ); } + + test insert + { + Bu::Array aInts; + aInts.insert( aInts.end(), 4 ); + aInts.insert( aInts.begin(), 1 ); + aInts.insert( aInts.end(), 5 ); + aInts.insert( aInts.begin()+1, 3 ); + aInts.insert( aInts.begin()+1, 2 ); + aInts.insert( aInts.begin(), 0 ); + + for( int j = 0; j < 6; j++ ) + { + unitTest( aInts[j] == j ); + } + } } -- cgit v1.2.3