aboutsummaryrefslogtreecommitdiff
path: root/src/unit
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2023-07-24 13:23:36 -0700
committerMike Buland <eichlan@xagasoft.com>2023-07-24 13:23:36 -0700
commitb544779d5b759d4ab2b82654e3f53b82ea41bac7 (patch)
treef0e224292a679e7e660b538c3f319af80bb820f1 /src/unit
parent247ea16cad1f78f57bdb00decfba602e3455372f (diff)
downloadlibbu++-b544779d5b759d4ab2b82654e3f53b82ea41bac7.tar.gz
libbu++-b544779d5b759d4ab2b82654e3f53b82ea41bac7.tar.bz2
libbu++-b544779d5b759d4ab2b82654e3f53b82ea41bac7.tar.xz
libbu++-b544779d5b759d4ab2b82654e3f53b82ea41bac7.zip
Added swap to array.
Diffstat (limited to 'src/unit')
-rw-r--r--src/unit/array.unit12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/unit/array.unit b/src/unit/array.unit
index e9f2bdf..e2c08eb 100644
--- a/src/unit/array.unit
+++ b/src/unit/array.unit
@@ -109,4 +109,16 @@ suite Array
109 aStr[1] = "Hello"; 109 aStr[1] = "Hello";
110 aStr[0] = aStr[1].clone(); 110 aStr[0] = aStr[1].clone();
111 } 111 }
112
113 test swap
114 {
115 Bu::Array<Bu::String> aStr( 3 );
116 aStr.append("One");
117 aStr.append("Three");
118 aStr.append("Two");
119
120 aStr.swap( 1, 2 );
121 unitTest( aStr[1] == "Two" );
122 unitTest( aStr[2] == "Three");
123 }
112} 124}