Skip to content

Commit

Permalink
test(identities): adding test for nil identityID
Browse files Browse the repository at this point in the history
  • Loading branch information
0xankit committed Dec 5, 2022
1 parent fe5806c commit 6b4ec6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/identities/internal/key/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ func Test_keyFromInterface(t *testing.T) {
want key
wantErr bool
}{
{"+ve", args{}, key{}, true},
{"+ve", args{nil}, key{nil}, true},
{"-ve", args{NewKey(nil)}, key{testIdentity}, false},
{"-ve", args{testIdentity}, key{nil}, true},
{"+ve", args{NewKey(testIdentity)}, key{testIdentity}, false},
{"-ve", args{baseIds.NewStringID("StringID")}, key{}, true},
}
Expand Down Expand Up @@ -109,6 +111,9 @@ func Test_key_Equals(t *testing.T) {
args args
want bool
}{
{"+ve", fields{nil}, args{key{nil}}, true},
{"-ve", fields{nil}, args{key{testIdentity}}, false},
{"-ve", fields{testIdentity}, args{key{nil}}, false},
{"+ve", fields{testIdentity}, args{key{testIdentity}}, true},
}
for _, tt := range tests {
Expand Down

0 comments on commit 6b4ec6c

Please sign in to comment.