Skip to content

Commit 35163e1

Browse files
author
Pouya Yarandi
committed
Fix failing test
1 parent 1ef69c9 commit 35163e1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/SwiftProtobuf/PathDecoder.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ extension Message {
3535
guard let type = Self.self as? any _ProtoNameProviding.Type else {
3636
return nil
3737
}
38-
return type._protobuf_nameMap.number(forJSONName: field)
38+
return Array(field.utf8).withUnsafeBytes { bytes in
39+
type._protobuf_nameMap.number(forProtoName: bytes)
40+
}
3941
}
4042

4143
static func name(for field: Int) -> String? {

Tests/SwiftProtobufTests/Test_FieldMask.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ final class Test_FieldMask: XCTestCase, PBTestHelpers {
213213
var message = SwiftProtoTesting_Fuzz_Message()
214214
message.singularInt32 = 1
215215
message.SwiftProtoTesting_Fuzz_singularInt32Ext = 1
216-
let mask = Google_Protobuf_FieldMask(protoPaths: ["singularString"])
216+
let mask = Google_Protobuf_FieldMask(protoPaths: ["singular_string"])
217217

218218
// Checks trim should retain extensions while removes other fields.
219219
let r1 = message.trim(fieldMask: mask)

0 commit comments

Comments
 (0)