writing-testslisted
Install: claude install-skill it-bens/cc-port
# Writing Tests
cc-port tests use `testutil.SetupFixture(t)` against `testdata/dotclaude/`. testify `require` for preconditions, `assert` for behavioral claims after the act. Table-driven via `t.Run`.
## Workflow
```dot
digraph test_workflow {
entry [shape=doublecircle, label="About to write\nor edit a test"];
behavior [shape=box, label="Identify the\nsingle behavior"];
observable [shape=diamond, label="Observable on the\nexported API?"];
seamable [shape=diamond, label="Production code wants\nthe seam regardless?"];
introduce_seam [shape=box, label="Introduce seam in\nproduction code first"];
reframe [shape=octagon, style=filled, fillcolor=red, label="Reframe at exported\nsurface or delete"];
arrange [shape=box, label="Source the\narrange data"];
body [shape=box, label="Structure the body\n(AAA or table row)"];
independence [shape=box, label="Guard\nindependence"];
gate [shape=box, label="Final quality gate"];
pass [shape=diamond, label="All checks\npass?"];
done [shape=doublecircle, label="Done"];
entry -> behavior;
behavior -> observable;
observable -> arrange [label="yes"];
observable -> seamable [label="no"];
seamable -> introduce_seam [label="yes"];
seamable -> reframe [label="no"];
introduce_seam -> arrange;
reframe -> behavior;
arrange -> body;
body -> independence;
independence -> gate;
gate -> pass;
pass -> done [label="yes"];
pass -> behavior [label="no"];
}
`