MCPcopy Create free account
hub / github.com/daodst/chat / TestWithLocalpartOnly

Function TestWithLocalpartOnly

clientapi/userutil/userutil_test.go:43–53  ·  view source on GitHub ↗

TestWithLocalpartOnly checks that localpart is returned when usernameParam contains only localpart.

(t *testing.T)

Source from the content-addressed store, hash-verified

41
42// TestWithLocalpartOnly checks that localpart is returned when usernameParam contains only localpart.
43func TestWithLocalpartOnly(t *testing.T) {
44 lp, err := ParseUsernameParam(localpart, &serverName)
45
46 if err != nil {
47 t.Error("User ID Parsing failed for ", localpart, " with error: ", err.Error())
48 }
49
50 if lp != localpart {
51 t.Error("Incorrect username, returned: ", lp, " should be: ", localpart)
52 }
53}
54
55// TestIncorrectDomain checks for error when there's server name mismatch.
56func TestIncorrectDomain(t *testing.T) {

Callers

nothing calls this directly

Calls 2

ParseUsernameParamFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected