mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
fix: order error in the tests
This commit is contained in:
parent
8061abe279
commit
3d302441b6
2 changed files with 11 additions and 4 deletions
|
@ -670,6 +670,7 @@ func getTags(
|
||||||
owners, err := expandTagOwners(aclPolicy, tag, stripEmailDomain)
|
owners, err := expandTagOwners(aclPolicy, tag, stripEmailDomain)
|
||||||
if errors.Is(err, errInvalidTag) {
|
if errors.Is(err, errInvalidTag) {
|
||||||
invalidTagMap[tag] = true
|
invalidTagMap[tag] = true
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
var found bool
|
var found bool
|
||||||
for _, owner := range owners {
|
for _, owner := range owners {
|
||||||
|
|
|
@ -385,11 +385,17 @@ func Test_getTags(t *testing.T) {
|
||||||
test.args.machine,
|
test.args.machine,
|
||||||
test.args.stripEmailDomain,
|
test.args.stripEmailDomain,
|
||||||
)
|
)
|
||||||
if !reflect.DeepEqual(gotValid, test.wantValid) {
|
for _, valid := range gotValid {
|
||||||
t.Errorf("getTags() = %v, want %v", gotValid, test.wantValid)
|
if !contains(test.wantValid, valid) {
|
||||||
|
t.Errorf("valids: getTags() = %v, want %v", gotValid, test.wantValid)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for _, invalid := range gotInvalid {
|
||||||
|
if !contains(test.wantInvalid, invalid) {
|
||||||
|
t.Errorf("invalids: getTags() = %v, want %v", gotInvalid, test.wantInvalid)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
if !reflect.DeepEqual(gotInvalid, test.wantInvalid) {
|
|
||||||
t.Errorf("getTags() = %v, want %v", gotInvalid, test.wantInvalid)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue