diff --git a/tests/simple/testdata/string_ext.textproto b/tests/simple/testdata/string_ext.textproto index d245558..c8ebf3d 100644 --- a/tests/simple/testdata/string_ext.textproto +++ b/tests/simple/testdata/string_ext.textproto @@ -632,6 +632,20 @@ section: { string_value: 'xyz', } } + test: { + name: "bytes support for string with invalid utf-8 sequences" + expr: '"%s".format([b"\\xF0abc\\x8C\\xF0xyz"])' + value: { + string_value: '\ufffdabc\ufffdxyz', + } + } + test: { + name: "bytes support for string with only invalid utf-8 sequences" + expr: '"%s".format([b"\\xF0\\x8C\\xF0"])' + value: { + string_value: '\ufffd', + } + } test: { name: "type() support for string" expr: '"%s".format([type("test string")])'