From 7f29f43fe2022671cc66502acb5e6d95eb777bc0 Mon Sep 17 00:00:00 2001 From: ewy Date: Wed, 22 Apr 2026 21:02:44 +0200 Subject: add tests for identities --- identity/identity.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'identity/identity.go') diff --git a/identity/identity.go b/identity/identity.go index 1ae13c6..06bd421 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -7,6 +7,10 @@ type Identity struct { Reduced string } +func (i Identity) I(other Identity) bool { + return i.Reduced == other.Reduced +} + func (i Identity) Is(input string) bool { reduced := Reduce(input) return i.Reduced == reduced @@ -23,6 +27,7 @@ func New(input string) Identity { func Reduce(input string) string { reduced := input + reduced = strings.TrimPrefix(input, ".") if !strings.HasPrefix(reduced, ".") { reduced = strings.Split(reduced, ".")[0] } -- cgit v1.3.1