mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 14:33:10 -06:00
Add test for invalid userID
This commit is contained in:
parent
f1509927d9
commit
c0a6fc5df9
|
|
@ -433,6 +433,7 @@ func Test_dedupeStateList(t *testing.T) {
|
||||||
alice := "@alice:localhost"
|
alice := "@alice:localhost"
|
||||||
bob := "@bob:localhost"
|
bob := "@bob:localhost"
|
||||||
charlie := "@charlie:notlocalhost"
|
charlie := "@charlie:notlocalhost"
|
||||||
|
invalidUserID := "iaminvalid:localhost"
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
|
@ -459,6 +460,11 @@ func Test_dedupeStateList(t *testing.T) {
|
||||||
staleLists: []string{alice, bob, charlie},
|
staleLists: []string{alice, bob, charlie},
|
||||||
want: []string{alice, charlie},
|
want: []string{alice, charlie},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "list with invalid userID",
|
||||||
|
staleLists: []string{alice, bob, invalidUserID},
|
||||||
|
want: []string{alice},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue