summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-05-26 15:04:56 -0400
committerEliot Horowitz <eliot@10gen.com>2010-05-26 15:04:56 -0400
commit3ffcb16346d34b614c8ffccf869efb2ce37f2a4b (patch)
tree3435777509ee6833252486d2b982e7c74f12812e /dbtests
parent2418b8cd35127f0ce522fb830379820ebb3404e7 (diff)
downloadmongo-3ffcb16346d34b614c8ffccf869efb2ce37f2a4b.tar.gz
some text utilities
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/basictests.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/dbtests/basictests.cpp b/dbtests/basictests.cpp
index 666d9aae536..1bb071dad9f 100644
--- a/dbtests/basictests.cpp
+++ b/dbtests/basictests.cpp
@@ -22,6 +22,7 @@
#include "dbtests.h"
#include "../util/base64.h"
#include "../util/array.h"
+#include "../util/text.h"
namespace BasicTests {
@@ -408,6 +409,22 @@ namespace BasicTests {
}
};
+ struct StringSplitterTest {
+
+ void test( string s ){
+ vector<string> v = StringSplitter::split( s , "," );
+ ASSERT_EQUALS( s , StringSplitter::join( v , "," ) );
+ }
+
+ void run(){
+ test( "a" );
+ test( "a,b" );
+ test( "a,b,c" );
+ }
+ };
+
+
+
class All : public Suite {
public:
All() : Suite( "basic" ){
@@ -431,6 +448,8 @@ namespace BasicTests {
add< DatabaseValidNames >();
add< PtrTests >();
+
+ add< StringSplitterTest >();
}
} myall;