mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-16 19:32:09 +03:00
* fix(inbounds): allow negative subSortIndex for subscription order Preserve explicitly set negative indices so primary inbounds can sort ahead of the default without renumbering peers; keep 0/omitted → 1. * fix(inbounds): gofumpt model.go and trim subSortIndex comments --------- Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com>
21 lines
353 B
Go
21 lines
353 B
Go
package service
|
|
|
|
import "testing"
|
|
|
|
func TestNormalizeSubSortIndex(t *testing.T) {
|
|
cases := []struct {
|
|
in, want int
|
|
}{
|
|
{0, 1},
|
|
{1, 1},
|
|
{7, 7},
|
|
{-1, -1},
|
|
{-10, -10},
|
|
}
|
|
for _, tc := range cases {
|
|
if got := normalizeSubSortIndex(tc.in); got != tc.want {
|
|
t.Fatalf("normalizeSubSortIndex(%d) = %d, want %d", tc.in, got, tc.want)
|
|
}
|
|
}
|
|
}
|