🔧 build:

Remove third-party packages
This commit is contained in:
xiaok29 2024-05-31 16:54:32 +08:00
parent 787e0e30f9
commit 258a17c4b6
3 changed files with 3 additions and 29 deletions

View File

@ -10,7 +10,6 @@ import (
"testing"
. "github.com/krahets/hello-algo/pkg"
"github.com/stretchr/testify/assert"
)
func TestQueue(t *testing.T) {
@ -47,20 +46,13 @@ func TestQueue(t *testing.T) {
}
func TestArrayQueue(t *testing.T) {
t.Run("pop", func(t *testing.T) {
queue := newArrayQueue(2)
assert.Equal(t, nil, queue.pop())
queue.push(1)
queue.push(2)
assert.Equal(t, 1, queue.pop())
assert.Equal(t, 2, queue.pop())
assert.Equal(t, []int{}, queue.toSlice())
})
// 初始化队列,使用队列的通用接口
capacity := 10
queue := newArrayQueue(capacity)
if queue.pop() != nil {
t.Errorf("want:%v,got:%v", nil, queue.pop())
}
// 元素入队
queue.push(1)

View File

@ -1,11 +1,3 @@
module github.com/krahets/hello-algo
go 1.19
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
require github.com/stretchr/testify v1.9.0

View File

@ -1,10 +0,0 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=