From eb3478997ead77c6fec5a967db5ec26e4c9f2e9f Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 16 Jan 2023 18:05:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stream/simpleStream_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/stream/simpleStream_test.go b/stream/simpleStream_test.go index 9754f9a..615acb0 100644 --- a/stream/simpleStream_test.go +++ b/stream/simpleStream_test.go @@ -482,3 +482,25 @@ func TestSimpleStreamFilterAndMap(t *testing.T) { }) } } + +func TestSimpleSliceStream_Len(t *testing.T) { + type testCase[T int] struct { + name string + r SimpleSliceStream[T] + want int + } + tests := []testCase[int]{ + { + name: "t1", + r: s, + want: 10, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := tt.r.Len(); got != tt.want { + t.Errorf("Len() = %v, want %v", got, tt.want) + } + }) + } +}