mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
21 lines
308 B
Go
21 lines
308 B
Go
package vals
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestFeed(t *testing.T) {
|
|
var fed []any
|
|
|
|
Feed(func(x any) bool {
|
|
fed = append(fed, x)
|
|
return x != 10
|
|
}, 1, 2, 3, 10, 11, 12, 13)
|
|
|
|
wantFed := []any{1, 2, 3, 10}
|
|
if !reflect.DeepEqual(fed, wantFed) {
|
|
t.Errorf("Fed %v, want %v", fed, wantFed)
|
|
}
|
|
}
|