Skip to content

Commit 109cd14

Browse files
committed
merge test
1 parent 4ac1d95 commit 109cd14

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/test/org/bson/BSONTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ public void testUTF8(){
157157

158158
}
159159

160-
161160
@Test
162161
public void testCustomEncoders()
163162
throws IOException{
@@ -306,6 +305,17 @@ else if ( o instanceof java.util.Date ) {
306305
}
307306
}
308307

308+
void _roundTrip( BSONObject o ){
309+
assertEquals( o , BSON.decode( BSON.encode( o ) ) );
310+
}
311+
312+
@Test
313+
public void testRandomRoundTrips(){
314+
_roundTrip( new BasicBSONObject( "a" , "" ) );
315+
_roundTrip( new BasicBSONObject( "a" , "a" ) );
316+
_roundTrip( new BasicBSONObject( "a" , "b" ) );
317+
}
318+
309319
List<String> _data = new ArrayList<String>();
310320

311321

0 commit comments

Comments
 (0)