MCPcopy Create free account
hub / github.com/github/gh-aw / TestSpec_PublicAPI_ExtractDomainFromURL

Function TestSpec_PublicAPI_ExtractDomainFromURL

pkg/stringutil/spec_test.go:444–448  ·  view source on GitHub ↗

TestSpec_PublicAPI_ExtractDomainFromURL validates the documented behavior of ExtractDomainFromURL as described in the package README.md. Specification: "Extracts the hostname (without port) from a URL string." Specification example: stringutil.ExtractDomainFromURL("https://api.github.com/repos")

(t *testing.T)

Source from the content-addressed store, hash-verified

442//
443// stringutil.ExtractDomainFromURL("https://api.github.com/repos") // "api.github.com"
444func TestSpec_PublicAPI_ExtractDomainFromURL(t *testing.T) {
445 result := ExtractDomainFromURL("https://api.github.com/repos")
446 assert.Equal(t, "api.github.com", result,
447 "ExtractDomainFromURL should return hostname without port (documented example)")
448}
449
450// TestSpec_PublicAPI_SanitizeIdentifierName validates the documented behavior
451// of SanitizeIdentifierName as described in the package README.md.

Callers

nothing calls this directly

Calls 1

ExtractDomainFromURLFunction · 0.85

Tested by

no test coverage detected