fn testUtf8EncodeError() !void 596
597
598
599
600
601
602fn testUtf8EncodeError() !void {
var array: [4]u8 = undefined;
try testErrorEncode(0xd800, array[0..], error.Utf8CannotEncodeSurrogateHalf);
try testErrorEncode(0xdfff, array[0..], error.Utf8CannotEncodeSurrogateHalf);
try testErrorEncode(0x110000, array[0..], error.CodepointTooLarge);
try testErrorEncode(0x1fffff, array[0..], error.CodepointTooLarge);
}