mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-29 16:47:28 +01:00
Add SIZE label
This commit is contained in:
parent
790b17c6a6
commit
8cd20d5ebb
@ -1174,5 +1174,6 @@ namespace mongo {
|
||||
Labeler::Label LT( "$lt" );
|
||||
Labeler::Label LTE( "$lte" );
|
||||
Labeler::Label NE( "$ne" );
|
||||
Labeler::Label SIZE( "$size" );
|
||||
|
||||
} // namespace mongo
|
||||
|
@ -781,6 +781,7 @@ namespace mongo {
|
||||
extern Labeler::Label LT;
|
||||
extern Labeler::Label LTE;
|
||||
extern Labeler::Label NE;
|
||||
extern Labeler::Label SIZE;
|
||||
|
||||
class BSONObjBuilderValueStream : public boost::noncopyable {
|
||||
public:
|
||||
|
@ -556,6 +556,15 @@ namespace JsobjTests {
|
||||
}
|
||||
};
|
||||
|
||||
class LabelSize : public LabelBase {
|
||||
BSONObj expected() {
|
||||
return BSON( "a" << BSON( "$size" << 4 ) );
|
||||
}
|
||||
BSONObj actual() {
|
||||
return BSON( "a" << SIZE << 4 );
|
||||
}
|
||||
};
|
||||
|
||||
class LabelMulti : public LabelBase {
|
||||
BSONObj expected() {
|
||||
return BSON( "z" << "q"
|
||||
@ -591,7 +600,6 @@ namespace JsobjTests {
|
||||
b2.done();
|
||||
b1.append( "f", 10.0 );
|
||||
BSONObj ret = b1.done();
|
||||
out() << "ret: " << ret << endl;
|
||||
ASSERT( ret.valid() );
|
||||
ASSERT( ret.woCompare( fromjson( "{a:'bcd',foo:{ggg:44},f:10}" ) ) == 0 );
|
||||
}
|
||||
@ -651,6 +659,7 @@ namespace JsobjTests {
|
||||
add< ValueStreamTests::LabelShares >();
|
||||
add< ValueStreamTests::LabelDouble >();
|
||||
add< ValueStreamTests::LabelDoubleShares >();
|
||||
add< ValueStreamTests::LabelSize >();
|
||||
add< ValueStreamTests::LabelMulti >();
|
||||
add< ValueStreamTests::Unallowed >();
|
||||
add< SubObjectBuilder >();
|
||||
|
Loading…
Reference in New Issue
Block a user