mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
Add `ParallelFilter` for concurrent filtering with context and error support. Add `UniqueInPlace` to remove duplicates from slices in place. Update README and add documentation and tests for both functions.
16 lines
302 B
Go
16 lines
302 B
Go
package underscore_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
u "github.com/rjNemo/underscore"
|
|
)
|
|
|
|
func TestUniqueInPlace(t *testing.T) {
|
|
nums := []int{1, 4, 2, 5, 3, 1, 5, 2, 8, 9}
|
|
got := u.UniqueInPlace(nums)
|
|
want := []int{1, 4, 2, 5, 3, 8, 9}
|
|
assert.Equal(t, want, got)
|
|
}
|