MCPcopy
hub / github.com/safing/portmaster / testEndpointMatch

Function testEndpointMatch

service/profile/endpoints/endpoints_test.go:128–142  ·  view source on GitHub ↗
(t *testing.T, ep Endpoint, entity *intel.Entity, expectedResult EPResult)

Source from the content-addressed store, hash-verified

126}
127
128func testEndpointMatch(t *testing.T, ep Endpoint, entity *intel.Entity, expectedResult EPResult) {
129 t.Helper()
130
131 result, _ := ep.Matches(context.TODO(), entity)
132 if result != expectedResult {
133 t.Errorf(
134 "line %d: unexpected result for endpoint %s and entity %+v: result=%s, expected=%s",
135 getLineNumberOfCaller(1),
136 ep,
137 entity,
138 result,
139 expectedResult,
140 )
141 }
142}
143
144func testFormat(t *testing.T, endpoint string, shouldSucceed bool) {
145 t.Helper()

Callers 1

TestEndpointMatchingFunction · 0.85

Calls 3

getLineNumberOfCallerFunction · 0.85
ErrorfMethod · 0.80
MatchesMethod · 0.65

Tested by

no test coverage detected