Removes testify + indirect deps from go.mod/go.sum; rewrites assert/require calls across cmd/dev/*, cmd/setup/*, devkit/* _test.go to stdlib t.Fatalf patterns. go vet clean. TestRunTestGen_Good fails pre-existing (missing cmd/dev/pkg/ env) at dev tip — unrelated to this PR. Closes tasks.lthn.sh/view.php?id=754 Co-authored-by: Codex <noreply@openai.com> Via-codex-lane: Cyclops-754 dispatch
36 lines
833 B
Go
36 lines
833 B
Go
package setup
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
"dappco.re/go/core/scm/repos"
|
|
)
|
|
|
|
func TestFilterReposByTypes_Good(t *testing.T) {
|
|
reposList := []*repos.Repo{
|
|
{Name: "foundation-a", Type: "foundation"},
|
|
{Name: "module-a", Type: "module"},
|
|
{Name: "product-a", Type: "product"},
|
|
}
|
|
|
|
filtered := filterReposByTypes(reposList, []string{"module", "product"})
|
|
|
|
mustLen(t, filtered, 2)
|
|
mustEqual(t, "module-a", filtered[0].Name)
|
|
mustEqual(t, "product-a", filtered[1].Name)
|
|
}
|
|
|
|
func TestFilterReposByTypes_EmptyFilter_Good(t *testing.T) {
|
|
reposList := []*repos.Repo{
|
|
{Name: "foundation-a", Type: "foundation"},
|
|
{Name: "module-a", Type: "module"},
|
|
}
|
|
|
|
filtered := filterReposByTypes(reposList, nil)
|
|
|
|
mustLen(t, filtered, 2)
|
|
if !reflect.DeepEqual(reposList, filtered) {
|
|
t.Fatalf("want %v, got %v", reposList, filtered)
|
|
}
|
|
}
|