MCPcopy Create free account
hub / github.com/foxcpp/maddy / TestEqual

Function TestEqual

framework/address/norm_test.go:64–79  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestEqual(t *testing.T) {
65 test := func(in1, in2 string, wantEq bool) {
66 eq := Equal(in1, in2)
67 if eq != wantEq {
68 t.Errorf("Want Equal(%s, %s) == %v, got %v", in1, in2, wantEq, eq)
69 }
70 }
71
72 test("test@example.org", "test@example.org", true)
73 test("test2@example.org", "test@example.org", false)
74 test("TEST2@example.org", "TesT2@example.org", true)
75 test("E\u0301@example.org", "\u00E9@example.org", true)
76 test("test@тест.example.org", "test@xn--e1aybc.example.org", true)
77 test("test@xn--999999999999999.example.org", "test@xn--999999999999999.example.org", true)
78 test("test@xn--999999999999.example.org", "test@xn--999999999999999.example.org", false)
79}
80
81func TestIsASCII(t *testing.T) {
82 if !IsASCII("hello") {

Callers

nothing calls this directly

Calls 2

testStruct · 0.85
EqualFunction · 0.70

Tested by

no test coverage detected