Skip to content

Commit

Permalink
remove external dependency testify
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiwei-Feng committed Jun 11, 2021
1 parent ea6fdf9 commit f046d95
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package challenge1countofsubsetsum

import (
"testing"

"github.com/stretchr/testify/assert"
)

func Test_countSubsets(t *testing.T) {
Expand All @@ -20,6 +18,10 @@ func Test_countSubsets(t *testing.T) {
{"case2", args{[]int{1, 2, 7, 1, 5}, 9}, 3},
}
for _, tt := range tests {
assert.Equal(t, countSubsets(tt.args.nums, tt.args.sum), tt.want)
t.Run(tt.name, func(t *testing.T) {
if got := countSubsets(tt.args.nums, tt.args.sum); got != tt.want {
t.Errorf("canPartition() = %v, want %v", got, tt.want)
}
})
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package Challenge2_Target_Sum

import (
"github.com/stretchr/testify/assert"
"testing"
)

Expand All @@ -21,6 +20,10 @@ func Test_findTargetSumWays(t *testing.T) {
{"case4", args{[]int{1, 2, 3, 4}, 3}, 0},
}
for _, tt := range tests {
assert.Equal(t, findTargetSumWays(tt.args.nums, tt.args.target), tt.want)
t.Run(tt.name, func(t *testing.T) {
if got := findTargetSumWays(tt.args.nums, tt.args.target); got != tt.want {
t.Errorf("canPartition() = %v, want %v", got, tt.want)
}
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package minimumsubsetsumdifference

import (
"testing"

"github.com/stretchr/testify/assert"
)

func Test_canPartition(t *testing.T) {
Expand All @@ -20,6 +18,10 @@ func Test_canPartition(t *testing.T) {
{"case3", args{[]int{1, 3, 100, 4}}, 92},
}
for _, tt := range tests {
assert.Equal(t, canPartition(tt.args.nums), tt.want)
t.Run(tt.name, func(t *testing.T) {
if got := canPartition(tt.args.nums); got != tt.want {
t.Errorf("canPartition() = %v, want %v", got, tt.want)
}
})
}
}
2 changes: 0 additions & 2 deletions Pattern15 - 01 Knapsack/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module pattern15

go 1.16

require github.com/stretchr/testify v1.7.0 // indirect
11 changes: 0 additions & 11 deletions Pattern15 - 01 Knapsack/go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/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/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit f046d95

Please sign in to comment.