| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5fbba81 commit 0315700
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1368,20 +1368,24 @@ public void testShortDebugString() { | |||
| 1368 | 1368 | @Test | |
| 1369 | 1369 | public void testShortDebugString_field() { | |
| 1370 | 1370 | 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")) | ||
| 1372 | 1375 | .isEqualTo("data: \"test data\""); | |
| 1373 | 1376 | ||
| 1374 | 1377 | final FieldDescriptor optionalField = | |
| 1375 | 1378 | TestAllTypes.getDescriptor().findFieldByName("optional_nested_message"); | |
| 1376 | 1379 | final Object value = NestedMessage.newBuilder().setBb(42).build(); | |
| 1377 | 1380 | ||
| 1378 | - assertThat(TextFormat.printer().shortDebugString(optionalField, value)) | ||
| 1381 | + assertThat( | ||
| 1382 | + TextFormat.printer().emittingSingleLine(true).printFieldToString(optionalField, value)) | ||
| 1379 | 1383 | .isEqualTo("optional_nested_message { bb: 42 }"); | |
| 1380 | 1384 | } | |
| 1381 | 1385 | ||
| 1382 | 1386 | @Test | |
| 1383 | 1387 | public void testShortDebugString_unknown() { | |
| 1384 | - assertThat(TextFormat.printer().shortDebugString(makeUnknownFieldSet())) | ||
| 1388 | + assertThat(TextFormat.printer().emittingSingleLine(true).printToString(makeUnknownFieldSet())) | ||
| 1385 | 1389 | .isEqualTo( | |
| 1386 | 1390 | "5: 1 5: 0x00000002 5: 0x0000000000000003 5: \"4\" 5: { 12: 6 } 5 { 10: 5 }" | |
| 1387 | 1391 | + " 8: 1 8: 2 8: 3 15: 12379813812177893520 15: 0xabcd1234 15:" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments