Files
h/pipeline/main_test.go
2024-02-15 19:42:13 +03:00

22 lines
246 B
Go

package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPipe(t *testing.T) {
a := make(chan int, 1)
pipe := func(in int) int {
return in * 2
}
b := Pipe(a, pipe)
a <- 5
close(a)
assert.Equal(t, 10, <-b)
}