0
mirror of https://github.com/XTLS/Xray-core.git synced 2025-06-08 18:03:35 +03:00

Tests: Real fix for TestCommanderListHandlers (#4792)

Completes 402067d281
This commit is contained in:
Meow 2025-06-08 12:47:04 +08:00 committed by GitHub
parent f38d3f786a
commit a576a4b183
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -286,7 +286,13 @@ func TestCommanderListHandlers(t *testing.T) {
t.Error("unexpected nil response")
}
if diff := cmp.Diff(inboundResp.Inbounds, clientConfig.Inbound, protocmp.Transform()); diff != "" {
if diff := cmp.Diff(
inboundResp.Inbounds,
clientConfig.Inbound,
protocmp.Transform(),
cmpopts.SortSlices(func(a, b *core.InboundHandlerConfig) bool {
return a.Tag < b.Tag
})); diff != "" {
t.Fatalf("inbound response doesn't match config (-want +got):\n%s", diff)
}
@ -296,7 +302,13 @@ func TestCommanderListHandlers(t *testing.T) {
t.Error("unexpected nil response")
}
if diff := cmp.Diff(outboundResp.Outbounds, clientConfig.Outbound, protocmp.Transform()); diff != "" {
if diff := cmp.Diff(
outboundResp.Outbounds,
clientConfig.Outbound,
protocmp.Transform(),
cmpopts.SortSlices(func(a, b *core.InboundHandlerConfig) bool {
return a.Tag < b.Tag
})); diff != "" {
t.Fatalf("outbound response doesn't match config (-want +got):\n%s", diff)
}
}