FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Automated Code Change · IBMZ-Linux-OSS-Python/protobuf@0315700 · GitHub

Commit 0315700

Browse files
Automated Code Change
PiperOrigin-RevId: 742051471
1 parent 5fbba81 commit 0315700

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎java/core/src/test/java/com/google/protobuf/TextFormatTest.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,20 +1368,24 @@ public void testShortDebugString() {
13681368
@Test
13691369
public void testShortDebugString_field() {
13701370
final FieldDescriptor dataField = OneString.getDescriptor().findFieldByName("data");
1371-
assertThat(TextFormat.printer().shortDebugString(dataField, "test data"))
1371+
assertThat(
1372+
TextFormat.printer()
1373+
.emittingSingleLine(true)
1374+
.printFieldToString(dataField, "test data"))
13721375
.isEqualTo("data: \"test data\"");
13731376

13741377
final FieldDescriptor optionalField =
13751378
TestAllTypes.getDescriptor().findFieldByName("optional_nested_message");
13761379
final Object value = NestedMessage.newBuilder().setBb(42).build();
13771380

1378-
assertThat(TextFormat.printer().shortDebugString(optionalField, value))
1381+
assertThat(
1382+
TextFormat.printer().emittingSingleLine(true).printFieldToString(optionalField, value))
13791383
.isEqualTo("optional_nested_message { bb: 42 }");
13801384
}
13811385

13821386
@Test
13831387
public void testShortDebugString_unknown() {
1384-
assertThat(TextFormat.printer().shortDebugString(makeUnknownFieldSet()))
1388+
assertThat(TextFormat.printer().emittingSingleLine(true).printToString(makeUnknownFieldSet()))
13851389
.isEqualTo(
13861390
"5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5: { 12: 6 } 5 { 10: 5 }"
13871391
+ " 8: 1 8: 2 8: 3 15: 12379813812177893520 15: 0xabcd1234 15:"

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL