feat: three sum
This commit is contained in:
26
pkg/three_sum/main_test.go
Normal file
26
pkg/three_sum/main_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package three_sum_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.maximhutz.com/practice/pkg/three_sum"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test1(t *testing.T) {
|
||||
assert.ElementsMatch(t,
|
||||
[][]int{{-1, -1, 2}, {-1, 0, 1}},
|
||||
three_sum.ThreeSum([]int{-1, 0, 1, 2, -1, -4}))
|
||||
}
|
||||
|
||||
func Test2(t *testing.T) {
|
||||
assert.Equal(t,
|
||||
[][]int{},
|
||||
three_sum.ThreeSum([]int{0, 1, 1}))
|
||||
}
|
||||
|
||||
func Test3(t *testing.T) {
|
||||
assert.Equal(t,
|
||||
[][]int{{0, 0, 0}},
|
||||
three_sum.ThreeSum([]int{0, 0, 0}))
|
||||
}
|
||||
Reference in New Issue
Block a user