MCPcopy Index your code
hub / github.com/imroc/req / TestSetMultipartBoundaryFunc

Function TestSetMultipartBoundaryFunc

client_test.go:532–547  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

530}
531
532func TestSetMultipartBoundaryFunc(t *testing.T) {
533 delimiter := "test-delimiter"
534 expectedContentType := fmt.Sprintf("multipart/form-data; boundary=%s", delimiter)
535 resp, err := tc().
536 SetMultipartBoundaryFunc(func() string {
537 return delimiter
538 }).R().
539 EnableForceMultipart().
540 SetFormData(
541 map[string]string{
542 "test": "test",
543 }).
544 Post("/content-type")
545 assertSuccess(t, resp, err)
546 tests.AssertEqual(t, expectedContentType, resp.String())
547}
548
549func TestFirefoxMultipartBoundaryFunc(t *testing.T) {
550 r := regexp.MustCompile(`^-------------------------\d{1,10}\d{1,10}\d{1,10}$`)

Callers

nothing calls this directly

Calls 9

AssertEqualFunction · 0.92
tcFunction · 0.85
assertSuccessFunction · 0.85
SetFormDataMethod · 0.80
EnableForceMultipartMethod · 0.80
RMethod · 0.80
PostMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…