-
Notifications
You must be signed in to change notification settings - Fork 6
/
empty_test.go
48 lines (44 loc) · 938 Bytes
/
empty_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package go2linq
import (
"iter"
"testing"
)
// https://github.com/jskeet/edulinq/blob/master/src/Edulinq.Tests/EmptyTest.cs
func TestEmpty_int(t *testing.T) {
tests := []struct {
name string
want iter.Seq[int]
}{
{name: "EmptyContainsNoElements",
want: Empty[int](),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := Empty[int]()
equal, _ := SequenceEqual(got, tt.want)
if !equal {
t.Errorf("Empty() = %v, want %v", StringDef(got), StringDef(tt.want))
}
})
}
}
func TestEmpty_string(t *testing.T) {
tests := []struct {
name string
want iter.Seq[string]
}{
{name: "EmptyContainsNoElements",
want: Empty[string](),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := Empty[string]()
equal, _ := SequenceEqual(got, tt.want)
if !equal {
t.Errorf("Empty() = %v, want %v", StringDef(got), StringDef(tt.want))
}
})
}
}