mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
12 lines
281 B
Go
12 lines
281 B
Go
package slice
|
|
|
|
import "testing"
|
|
|
|
func TestUniqueByFieldUnreadableInputs(t *testing.T) {
|
|
for _, input := range []any{nil, struct{ hidden string }{"value"}} {
|
|
if _, err := UniqueByField([]any{input}, "hidden"); err == nil {
|
|
t.Errorf("expected an error for %T", input)
|
|
}
|
|
}
|
|
}
|