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
40 lines
897 B
Go
40 lines
897 B
Go
package dev
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"dappco.re/go/core/cli/pkg/cli"
|
|
)
|
|
|
|
func TestAddVMStatusCommand_Good(t *testing.T) {
|
|
root := &cli.Command{Use: "core"}
|
|
|
|
AddDevCommands(root)
|
|
|
|
statusCmd, _, err := root.Find([]string{"dev", "status"})
|
|
mustNoError(t, err)
|
|
if statusCmd == nil {
|
|
t.Fatal("expected non-nil status command")
|
|
}
|
|
mustEqual(t, "status", statusCmd.Use)
|
|
mustContainsAlias(t, statusCmd.Aliases, "vm-status")
|
|
|
|
aliasCmd, _, err := root.Find([]string{"dev", "vm-status"})
|
|
mustNoError(t, err)
|
|
if aliasCmd == nil {
|
|
t.Fatal("expected non-nil alias command")
|
|
}
|
|
if statusCmd != aliasCmd {
|
|
t.Fatalf("want alias to be same command, got %v vs %v", statusCmd, aliasCmd)
|
|
}
|
|
}
|
|
|
|
func mustContainsAlias(t *testing.T, haystack []string, needle string) {
|
|
t.Helper()
|
|
for _, s := range haystack {
|
|
if s == needle {
|
|
return
|
|
}
|
|
}
|
|
t.Fatalf("expected %v to contain %q", haystack, needle)
|
|
}
|