From a69217b584aa6e4e9fc2347a28ba2aa29429792a Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 24 Oct 2018 22:37:11 +0200 Subject: [PATCH] test case --- common/mux/client_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common/mux/client_test.go diff --git a/common/mux/client_test.go b/common/mux/client_test.go new file mode 100644 index 000000000..8c86af811 --- /dev/null +++ b/common/mux/client_test.go @@ -0,0 +1,21 @@ +package mux_test + +import ( + "testing" + + "v2ray.com/core/common/errors" + "v2ray.com/core/common/mux" +) + +func TestIncrementalPickerFailure(t *testing.T) { + picker := mux.IncrementalWorkerPicker{ + New: func() (*mux.ClientWorker, error) { + return nil, errors.New("test") + }, + } + + _, err := picker.PickAvailable() + if err == nil { + t.Error("expected error, but nil") + } +}