truncateForName renders a byte slice for use as a subtest name, capping the length so deeply-nested seeds (100 KB) don't produce gigantic test IDs.
(b []byte)
| 765 | // truncateForName renders a byte slice for use as a subtest name, capping the |
| 766 | // length so deeply-nested seeds (100 KB) don't produce gigantic test IDs. |
| 767 | func truncateForName(b []byte) string { |
| 768 | const max = 40 |
| 769 | s := fmt.Sprintf("%q", b) |
| 770 | if len(s) <= max { |
| 771 | return s |
| 772 | } |
| 773 | return s[:max] + "..." |
| 774 | } |
no outgoing calls
no test coverage detected