summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-07-20 23:16:48 -0400
committerEliot Horowitz <eliot@10gen.com>2010-07-20 23:16:48 -0400
commit9bc4aea8ba3ea9dc539753e8cb9b5046c74badbb (patch)
tree7639ed541af9e90d62265a40b179fc4c7fd2265a /dbtests
parent6c055169e6d8dba7e69e947bacf0e71c3644166f (diff)
downloadmongo-9bc4aea8ba3ea9dc539753e8cb9b5046c74badbb.tar.gz
operator < > <= >= for BSONObj
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/jsobjtests.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/dbtests/jsobjtests.cpp b/dbtests/jsobjtests.cpp
index 713af6b7b64..de65a5f1c5e 100644
--- a/dbtests/jsobjtests.cpp
+++ b/dbtests/jsobjtests.cpp
@@ -1606,6 +1606,27 @@ namespace JsobjTests {
}
};
+ class CompareOps {
+ public:
+ void run(){
+
+ BSONObj a = BSON("a"<<1);
+ BSONObj b = BSON("a"<<1);
+ BSONObj c = BSON("a"<<2);
+ BSONObj d = BSON("a"<<3);
+ BSONObj e = BSON("a"<<4);
+ BSONObj f = BSON("a"<<4);
+
+ ASSERT( ! ( a < b ) );
+ ASSERT( a <= b );
+ ASSERT( a < c );
+
+ ASSERT( f > d );
+ ASSERT( f >= e );
+ ASSERT( ! ( f > e ) );
+ }
+ };
+
class All : public Suite {
public:
All() : Suite( "jsobj" ){
@@ -1712,6 +1733,7 @@ namespace JsobjTests {
add< BSONFieldTests >();
add< BSONForEachTest >();
add< StringDataTest >();
+ add< CompareOps >();
}
} myall;