(t *testing.T)
| 228 | } |
| 229 | |
| 230 | func TestAnonymizString_MemorizedDomain(t *testing.T) { |
| 231 | anonymizer := anonymize.NewAnonymizer(netip.Addr{}, netip.Addr{}) |
| 232 | domain := "example.com" |
| 233 | anonymizedDomain := anonymizer.AnonymizeDomain(domain) |
| 234 | |
| 235 | sampleString := "This is a test string including the domain example.com which should be anonymized." |
| 236 | |
| 237 | firstPassResult := anonymizer.AnonymizeString(sampleString) |
| 238 | secondPassResult := anonymizer.AnonymizeString(firstPassResult) |
| 239 | |
| 240 | assert.Contains(t, firstPassResult, anonymizedDomain, "The domain should be anonymized in the first pass") |
| 241 | assert.NotContains(t, firstPassResult, domain, "The original domain should not appear in the first pass output") |
| 242 | |
| 243 | assert.Equal(t, firstPassResult, secondPassResult, "The second pass should not further anonymize the string") |
| 244 | } |
| 245 | |
| 246 | func TestAnonymizeString_DoubleURI(t *testing.T) { |
| 247 | anonymizer := anonymize.NewAnonymizer(netip.Addr{}, netip.Addr{}) |
nothing calls this directly
no test coverage detected