diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-06-13 23:30:03 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-06-13 23:30:03 -0400 |
commit | 004cd26deee50b7fdf060c06605bbce37bc09794 (patch) | |
tree | 17b96b4b5f6f7d56bb9b66d2f17c7b5ea00c684a /dbtests | |
parent | a4a895e1f064b25512a9e1450f6866d1430512d7 (diff) | |
download | mongo-004cd26deee50b7fdf060c06605bbce37bc09794.tar.gz |
fix appending BSONElement via <<
Diffstat (limited to 'dbtests')
-rw-r--r-- | dbtests/jsobjtests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dbtests/jsobjtests.cpp b/dbtests/jsobjtests.cpp index 679d7da6c1b..46575bc1e6f 100644 --- a/dbtests/jsobjtests.cpp +++ b/dbtests/jsobjtests.cpp @@ -617,6 +617,17 @@ namespace JsobjTests { } }; + class ElementAppend { + public: + void run(){ + BSONObj a = BSON( "a" << 17 ); + BSONObj b = BSON( "b" << a["a"] ); + ASSERT_EQUALS( NumberInt , a["a"].type() ); + ASSERT_EQUALS( NumberInt , b["b"].type() ); + ASSERT_EQUALS( 17 , b["b"].number() ); + } + }; + } // namespace ValueStreamTests class SubObjectBuilder { @@ -692,6 +703,7 @@ namespace JsobjTests { add< ValueStreamTests::LabelSize >(); add< ValueStreamTests::LabelMulti >(); add< ValueStreamTests::Unallowed >(); + add< ValueStreamTests::ElementAppend >(); add< SubObjectBuilder >(); } }; |