github.com/laof/lite-speed-test@v0.0.0-20230930011949-1f39b7037845/api/rpc/liteclient/client_test.go (about) 1 package liteclient 2 3 import ( 4 "testing" 5 6 pb "github.com/laof/lite-speed-test/api/rpc/lite" 7 s "github.com/laof/lite-speed-test/api/rpc/liteserver" 8 ) 9 10 func TestStartClient(t *testing.T) { 11 go s.StartServer(10999) 12 req := pb.TestRequest{ 13 GroupName: "Default", 14 SpeedTestMode: pb.SpeedTestMode_all, 15 PingMethod: pb.PingMethod_googleping, 16 SortMethod: pb.SortMethod_rspeed, 17 Concurrency: 2, 18 TestMode: 2, 19 Subscription: "https://raw.githubusercontent.com/freefq/free/master/v2", 20 Language: "en", 21 FontSize: 24, 22 Theme: "rainbow", 23 Timeout: 10, 24 OutputMode: 0, 25 } 26 reply, err := StartClient("127.0.0.1:10999", &req) 27 if err != nil { 28 t.Fatal(err) 29 } 30 if len(reply) < 1 { 31 t.Fail() 32 } 33 }