Skip to content

Commit 651809f

Browse files
author
Roman Janusz
committed
test fix
1 parent 57edf78 commit 651809f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

commons-mongo/jvm/src/test/scala/com/avsystem/commons/mongo/BsonInputOutputTest.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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))

0 commit comments

Comments
 (0)