MCPcopy Index your code
hub / github.com/labstack/echo / TestGroup_Static

Function TestGroup_Static

group_test.go:449–466  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

447}
448
449func TestGroup_Static(t *testing.T) {
450 e := New()
451
452 g := e.Group("/books")
453 ri := g.Static("/download", "_fixture")
454 assert.Equal(t, http.MethodGet, ri.Method)
455 assert.Equal(t, "/books/download*", ri.Path)
456 assert.Equal(t, "GET:/books/download*", ri.Name)
457 assert.Equal(t, []string{"*"}, ri.Parameters)
458
459 req := httptest.NewRequest(http.MethodGet, "/books/download/index.html", nil)
460 rec := httptest.NewRecorder()
461 e.ServeHTTP(rec, req)
462
463 assert.Equal(t, http.StatusOK, rec.Code)
464 body := rec.Body.String()
465 assert.True(t, strings.HasPrefix(body, "<!doctype html>"))
466}
467
468func TestGroup_StaticMultiTest(t *testing.T) {
469 var testCases = []struct {

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
ServeHTTPMethod · 0.80
GroupMethod · 0.45
StaticMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…