Skip to content
Agentmart
Submit a tool

codegen-testing

Skill by sazardev

IndexedMIT★ 304
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/sazardev-codegen-testing

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The publisher has not written a description yet.

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
codegen-testing
Description
None
License
MIT
Instructions
321 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • missing YAML frontmatter
  • name: missing
  • description: missing

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Skill: Goca Code Generation Testing

**Domain:** Writing tests for Goca's code generation pipeline. Covers unit tests for validators and template generators, and integration tests that verify generated code compiles and is functionally correct.

---

## Testing Philosophy for Code Generators

Goca generates code, so tests have two distinct layers:

1. **Generator tests** — verify the generator produces the right output strings
2. **Compilation tests** — verify the generated output actually compiles as valid Go

Both layers are mandatory. A generator test alone is insufficient — template changes can produce syntactically correct template output but invalid Go code.

---

## Unit Test Patterns

### Testing `CommandValidator`

```go
func TestCommandValidator_ValidateEntityName(t *testing.T) {
    t.Parallel()
    v := NewCommandValidator()

    cases := []struct {
        name    string
        input   string
        wantErr bool
    }{
        {"valid", "Product", false},
        {"valid with numbers", "Product1", false},
        {"empty", "", true},
        {"starts with digit", "1Product", true},
        {"path traversal", "../etc", true},
        {"slash", "foo/bar", true},
        {"dot", "foo.bar", true},
        {"underscore", "foo_bar", false}, // or true depending on your convention
        {"very long", strings.Repeat("A", 1000), true},
        {"null byte", "Product\x00Name", true},
        {"shell meta", "Product;rm -rf /", true},
    }

    for _, tc := range cases {
        tc := tc
        t.Run(tc.name, func(t *testing.T) {
            t.Parallel()
            err := v.ValidateEntityName(tc.input)
            if tc.wantErr {
                assert.Error(t, err)
            } else {
                assert.NoError(t, err)
            }
        })
    }
}
```

### Testing `FieldValidator`

```go
func TestFieldValidator_ParseFields(t *testing.T) {
    t.Parallel()
    v := NewFieldValidator()

    cases := []struct {
        name       string
        input      string
        wantLen    int
        wantFirst  FieldData
        wantErr    bool
    }{
        {
            name:    "single field",
            input:   "Name:string",
            wantLen: 1,
            wantFirst: FieldData{Name: "Name", Type: "string"},
        },
        {
            name:    "multiple fields",
            input:   "Name:string,Price:float64,Active:bool",
            wantLen: 3,
        },
        {
            name:    "pointer type",
            input:   "Parent:*Category",
            wantLen: 1,
        },
        {
            name:    "map type",
            input:   "Meta:map[string]string",
            wantLen: 1,
        },
        {
            name:    "empty",
            input:   "",
            wantLen: 0,
        },
        {
            name:    "missing type",
            input:   "Name:",
            wantErr: true,
        },
    }
    // ...
}
```

### Testing `TemplateGenerator`

```go
func TestTemplateGenerator_EntityTemplate(t *testing.T) {
    t.Parallel()

    data := TemplateData{
        Entity: EntityData{
            Name:      "Product",
            NameLower: "product",
            Package:   "domain",

From sazardev/goca, MIT.

Signals

Stars
304
Forks
11
Open issues
0
Last commit (this folder)
Mar 24, 2026 (7 months ago)
Last release
Jul 12, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from sazardev

Cite this page

codegen-testing skill. Agent Mart. https://agentmart.dev/skills/sazardev-codegen-testing (last updated 2026-10-24)