mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
md2codex / md2gemini named the *input* (markdown) and read poorly. Rename the bundled extensions after what they produce: codex-agents and gemini-commands. Turn the BuiltinExtensions catalog into structs carrying a human-readable description so the dashboard can explain each one before install, and propagate the new names across tests and docs.
28 lines
834 B
Go
28 lines
834 B
Go
package install
|
|
|
|
import "testing"
|
|
|
|
func TestIsBuiltinExtension(t *testing.T) {
|
|
for _, b := range BuiltinExtensions {
|
|
if !IsBuiltinExtension(b.Name) {
|
|
t.Errorf("%q should be a built-in extension", b.Name)
|
|
}
|
|
if b.Description == "" {
|
|
t.Errorf("built-in %q must have a catalog description", b.Name)
|
|
}
|
|
}
|
|
for _, bad := range []string{"", "../evil", "codex-agents/..", "unknown"} {
|
|
if IsBuiltinExtension(bad) {
|
|
t.Errorf("%q must not be reported as built-in", bad)
|
|
}
|
|
}
|
|
}
|
|
|
|
// InstallBuiltinExtension must reject unknown/traversal names before any
|
|
// network access, so the whitelist guards the download path.
|
|
func TestInstallBuiltinExtension_RejectsUnknown(t *testing.T) {
|
|
if err := InstallBuiltinExtension("../../etc", t.TempDir()); err == nil {
|
|
t.Fatal("expected error for unknown/traversal extension name")
|
|
}
|
|
}
|