MCPcopy Index your code
hub / github.com/apache/devlake / TestConvertUnicode

Function TestConvertUnicode

backend/plugins/tapd/tasks/shared_test.go:206–229  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func TestConvertUnicode(t *testing.T) {
207 testStruct := struct {
208 ValueBeforeParsed string
209 ValueAfterParsed string
210 }{
211 ValueBeforeParsed: "Hello, \\u4e16\\u754c!",
212 ValueAfterParsed: "--",
213 }
214
215 err := convertUnicode(&testStruct)
216 if err != nil {
217 t.Errorf("Unexpected error: %v", err)
218 }
219
220 expectedBefore := "Hello, 世界!"
221 if testStruct.ValueBeforeParsed != expectedBefore {
222 t.Errorf("Expected ValueBeforeParsed to be %q, but got %q", expectedBefore, testStruct.ValueBeforeParsed)
223 }
224
225 expectedAfter := ""
226 if testStruct.ValueAfterParsed != expectedAfter {
227 t.Errorf("Expected ValueAfterParsed to be %q, but got %q", expectedAfter, testStruct.ValueAfterParsed)
228 }
229}
230
231func TestGenerateDomainAccountIdForUsers(t *testing.T) {
232 connectionId := uint64(123)

Callers

nothing calls this directly

Calls 1

convertUnicodeFunction · 0.85

Tested by

no test coverage detected