MCPcopy Create free account
hub / github.com/apache/fory / TestEncodeWithEncodingNonAscii

Function TestEncodeWithEncodingNonAscii

go/fory/meta/meta_string_test.go:101–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func TestEncodeWithEncodingNonAscii(t *testing.T) {
102 encoder := NewEncoder('.', '_')
103
104 _, err := encoder.EncodeWithEncoding("こんにちは", LOWER_SPECIAL)
105 require.Error(t, err, "Expected error for non-ASCII characters in non-UTF-8 encoding")
106 require.Equal(t, "non-ASCII characters in meta string are not allowed", err.Error())
107}

Callers

nothing calls this directly

Calls 4

EncodeWithEncodingMethod · 0.95
NewEncoderFunction · 0.85
ErrorMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected