summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorShaun Verch <shaun.verch@mongodb.com>2014-06-19 16:02:15 -0400
committerShaun Verch <shaun.verch@mongodb.com>2014-06-25 16:04:47 -0400
commitcaa0432e6e3f3f5355dcedbc2352625b07453435 (patch)
tree9578112ea3a1780f0b8e5b5247962773749171db /src/mongo/dbtests
parentcdfdc8ee6bbe09cc76724a2f559fe0dc98faa220 (diff)
downloadmongo-caa0432e6e3f3f5355dcedbc2352625b07453435.tar.gz
SERVER-14315 Support MinKey and MaxKey extended JSON objects in JSON parser
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/jsontests.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mongo/dbtests/jsontests.cpp b/src/mongo/dbtests/jsontests.cpp
index 607e319a081..a561fca0fe5 100644
--- a/src/mongo/dbtests/jsontests.cpp
+++ b/src/mongo/dbtests/jsontests.cpp
@@ -2628,6 +2628,40 @@ namespace JsonTests {
}
};
+ class MinKeyAlone : public Bad {
+ virtual string json() const {
+ return "{ \"$minKey\" : 1 }";
+ }
+ };
+
+ class MaxKeyAlone : public Bad {
+ virtual string json() const {
+ return "{ \"$maxKey\" : 1 }";
+ }
+ };
+
+ class MinKey : public Base {
+ virtual BSONObj bson() const {
+ BSONObjBuilder b;
+ b.appendMinKey("a");
+ return b.obj();
+ }
+ virtual string json() const {
+ return "{ \"a\" : { \"$minKey\" : 1 } }";
+ }
+ };
+
+ class MaxKey : public Base {
+ virtual BSONObj bson() const {
+ BSONObjBuilder b;
+ b.appendMaxKey("a");
+ return b.obj();
+ }
+ virtual string json() const {
+ return "{ \"a\" : { \"$maxKey\" : 1 } }";
+ }
+ };
+
} // namespace FromJsonTests
class All : public Suite {
@@ -2889,6 +2923,8 @@ namespace JsonTests {
add< FromJsonTests::EmbeddedDatesFormat3 >();
add< FromJsonTests::NullString >();
add< FromJsonTests::NullFieldUnquoted >();
+ add< FromJsonTests::MinKey >();
+ add< FromJsonTests::MaxKey >();
}
} myall;