MCPcopy
hub / github.com/caddyserver/caddy / TestFirstSplit

Function TestFirstSplit

modules/caddyhttp/fileserver/matcher_test.go:404–418  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

402}
403
404func TestFirstSplit(t *testing.T) {
405 m := MatchFile{
406 SplitPath: []string{".php"},
407 fsmap: &filesystems.FileSystemMap{},
408 }
409 actual, remainder := m.firstSplit("index.PHP/somewhere")
410 expected := "index.PHP"
411 expectedRemainder := "/somewhere"
412 if actual != expected {
413 t.Errorf("Expected split %s but got %s", expected, actual)
414 }
415 if remainder != expectedRemainder {
416 t.Errorf("Expected remainder %s but got %s", expectedRemainder, remainder)
417 }
418}
419
420var expressionTests = []struct {
421 name string

Callers

nothing calls this directly

Calls 1

firstSplitMethod · 0.95

Tested by

no test coverage detected