sync: 同步 v1.0.4 并脱敏配置与镜像
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAllocateInputLimit(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
input string
|
||||
wantError bool
|
||||
}{
|
||||
{"empty", " \r\n\t", true},
|
||||
{"ignore blanks", "\r\n123\r\n\n456 789 012\n", false},
|
||||
{"at limit", strings.Repeat("123\n", SimCardAllocateMaxInputRows), false},
|
||||
{"above limit", strings.Repeat("123\n", SimCardAllocateMaxInputRows+1), true},
|
||||
} {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
param := &TSimCardAllocatePrepareParam{Input: test.input}
|
||||
if err := param.ValidateInput(); (err != nil) != test.wantError {
|
||||
t.Fatalf("ValidateInput() = %v, wantError = %v", err, test.wantError)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user