aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNicolas Catania <niko@google.com>2010-01-28 16:48:34 -0800
committerNicolas Catania <niko@google.com>2010-01-30 16:59:41 -0800
commit74a6fdea77d52a17be4bc38831fe02a31cefbf34 (patch)
tree4ee780faead236dddaa2d0eda7b3e5febbcac138 /tests
parent2f8be091d59666a33e3fd11fca1ce71f0a90edbc (diff)
downloadastl-74a6fdea77d52a17be4bc38831fe02a31cefbf34.tar.gz
Added the 'at' method to string.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_string.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_string.cpp b/tests/test_string.cpp
index 60c02aa..337d879 100644
--- a/tests/test_string.cpp
+++ b/tests/test_string.cpp
@@ -542,6 +542,14 @@ bool testAccessor()
str05.reserve(100);
str05[99] = 'a';
+ // 'at'
+ EXPECT_TRUE(str01.at(0) == 'E');
+ EXPECT_TRUE(str01.at(7) == 'S');
+ EXPECT_TRUE(str01.at(8) == 'X'); // 'X' is the dummy value returned.
+
+ str01.at(1) = 'A';
+ str01.at(6) = 'K';
+ EXPECT_TRUE(str01 == "EArmarKS");
return true;
}