Files
zzet--gortex/cmd/gortex/explore_test.go
T
wehub-resource-sync a06f331eb8
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:33:42 +08:00

33 lines
958 B
Go

package main
import "testing"
// TestExploreCmdBuildsArgs covers the smart_context argument shaping the
// explore verb performs, including omission of empty optionals.
func TestExploreCmdBuildsArgs(t *testing.T) {
args := buildExploreArgs("find the parser", "internal/p.go::Parse", "gcx", 7)
if args["task"] != "find the parser" {
t.Errorf("task = %v", args["task"])
}
if args["entry_point"] != "internal/p.go::Parse" {
t.Errorf("entry_point = %v", args["entry_point"])
}
if args["format"] != "gcx" {
t.Errorf("format = %v", args["format"])
}
if args["max_symbols"] != 7 {
t.Errorf("max_symbols = %v", args["max_symbols"])
}
bare := buildExploreArgs("t", "", "", 5)
if _, ok := bare["entry_point"]; ok {
t.Error("an empty entry_point must be omitted")
}
if _, ok := bare["format"]; ok {
t.Error("an empty format must be omitted")
}
if bare["max_symbols"] != 5 {
t.Errorf("max_symbols = %v, want 5", bare["max_symbols"])
}
}