|
@@ -169,6 +169,14 @@ func TestHead(t *testing.T) {
|
|
assert.Equal(t, 3, result)
|
|
assert.Equal(t, 3, result)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func TestHeadZero(t *testing.T) {
|
|
|
|
+ assert.Panics(t, func() {
|
|
|
|
+ Just(1, 2, 3, 4).Head(0).Reduce(func(pipe <-chan interface{}) (interface{}, error) {
|
|
|
|
+ return nil, nil
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
func TestHeadMore(t *testing.T) {
|
|
func TestHeadMore(t *testing.T) {
|
|
var result int
|
|
var result int
|
|
Just(1, 2, 3, 4).Head(6).Reduce(func(pipe <-chan interface{}) (interface{}, error) {
|
|
Just(1, 2, 3, 4).Head(6).Reduce(func(pipe <-chan interface{}) (interface{}, error) {
|