File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
commons-mongo/jvm/src/test/scala/com/avsystem/commons/mongo Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -302,12 +302,15 @@ class BsonInputOutputTest extends AnyFunSuite with ScalaCheckPropertyChecks {
302302 doc
303303 }
304304
305+ def longBson (l : Long ): BsonValue =
306+ if (l.isValidInt) new BsonInt32 (l.toInt) else new BsonInt64 (l)
307+
305308 def somethingToBson (s : SomethingPlain ): BsonDocument = {
306309 new BsonDocument ()
307310 .append(" string" , new BsonString (s.string))
308311 .append(" boolean" , new BsonBoolean (s.boolean))
309312 .append(" int" , new BsonInt32 (s.int))
310- .append(" long" , new BsonInt64 (s.long))
313+ .append(" long" , longBson (s.long))
311314 .append(" timestamp" , new BsonDateTime (s.timestamp.getTime))
312315 .append(" double" , new BsonDouble (s.double))
313316 .append(" binary" , new BsonBinary (s.binary.bytes))
You can’t perform that action at this time.
0 commit comments