Skip to content

Commit dd0ffda

Browse files
authored
SWIFT-968 Enable Decimal128 parseError assertion (#43)
1 parent 286004e commit dd0ffda

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Sources/BSON/BSONDocument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public struct BSONDocument {
298298
self.storage = newStorage
299299
self.byteLength = newSize
300300
guard self.byteLength == self.storage.buffer.readableBytes else {
301-
fatalError("BSONDocument's encoded byte length is \(self.byteLength) however the" +
301+
fatalError("BSONDocument's encoded byte length is \(self.byteLength), however the " +
302302
"buffer has \(self.storage.buffer.readableBytes) readable bytes")
303303
}
304304
}

Tests/BSONTests/BSONCorpusTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,11 @@ final class BSONCorpusTests: BSONTestCase {
251251
expect(try decoder.decode(BSONDocument.self, from: testData))
252252
.to(throwError(errorType: DecodingError.self), description: description)
253253
case .decimal128:
254-
continue // TODO: SWIFT-968
254+
expect(try BSONDecimal128(test.string))
255+
.to(throwError(), description: description)
255256
default:
256257
throw TestError(
257-
message: "\(description): parse error tests not implemented"
258+
message: "\(description): parse error tests not implemented "
258259
+ "for bson type \(testFile.bsonType)"
259260
)
260261
}

0 commit comments

Comments
 (0)