Skip to content

Commit a58c816

Browse files
committed
Change assertion to print strings that are unexpectedly non-ASCII.
1 parent a7a6ff0 commit a58c816

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/truffleruby/core/rope/RopeOperations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static LeafRope encodeAscii(String value, Encoding encoding) {
142142

143143
/** Prefer this to {@code getBytes(StandardCharsets.US_ASCII)} */
144144
public static byte[] encodeAsciiBytes(String value) {
145-
assert StringOperations.isAsciiOnly(value);
145+
assert StringOperations.isAsciiOnly(value) : "String contained non ascii characters \"" + value + "\"";
146146

147147
final byte[] bytes = new byte[value.length()];
148148

0 commit comments

Comments
 (0)