summaryrefslogtreecommitdiff
path: root/identity/identity_test.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-22 21:02:44 +0200
committerewy <ewy0@protonmail.com>2026-04-22 21:02:44 +0200
commit7f29f43fe2022671cc66502acb5e6d95eb777bc0 (patch)
tree1541ef56be13c15e628620b481c5a818f41cda4b /identity/identity_test.go
parent35fd641be06ed0e79ed995f685f40fec8fc57504 (diff)
add tests for identities
Diffstat (limited to 'identity/identity_test.go')
-rw-r--r--identity/identity_test.go46
1 files changed, 46 insertions, 0 deletions
diff --git a/identity/identity_test.go b/identity/identity_test.go
new file mode 100644
index 0000000..5dae8be
--- /dev/null
+++ b/identity/identity_test.go
@@ -0,0 +1,46 @@
+//go:build test
+
+package identity
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestIdentity(t *testing.T) {
+ a := New("asdf")
+ b := New("asdf")
+ c := New("hhhh")
+ assert.True(t, a.I(b))
+ assert.False(t, a.I(c))
+}
+
+func TestIdentity_Extension(t *testing.T) {
+ a := New("asdf.sh")
+ b := New("asdf")
+ c := New("hhhh")
+ assert.True(t, a.I(b))
+ assert.False(t, a.I(c))
+}
+
+func TestIdentity_Hidden(t *testing.T) {
+ a := New(".asdf")
+ b := New("asdf")
+ c := New("hhhh")
+ assert.True(t, a.I(b))
+ assert.False(t, a.I(c))
+}
+
+func TestIdentity_I_Tagged(t *testing.T) {
+ a := New("asdf.pre.sh")
+ b := New("asdf")
+ c := New("hhhh")
+ assert.True(t, a.I(b))
+ assert.False(t, a.I(c))
+}
+
+func TestIdentity_Is(t *testing.T) {
+ a := New(".asdf.iahsodiu.txt")
+ b := "asdf"
+ assert.True(t, a.Is(b))
+}