Skills swift-testing-code-review
Reviews Swift Testing code for proper use of #expect/#require, parameterized tests, async testing, and organization. Use when reviewing .swift files with import Testing, @Test, #expect, @Suite, or confirmation patterns.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/anderskev/swift-testing-code-review" ~/.claude/skills/openclaw-skills-swift-testing-code-review && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/anderskev/swift-testing-code-review" ~/.openclaw/skills/openclaw-skills-swift-testing-code-review && rm -rf "$T"
manifest:
skills/anderskev/swift-testing-code-review/SKILL.mdsource content
Swift Testing Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| #expect vs #require, expression capture, error testing | references/expect-macro.md |
| @Test with arguments, traits, zip() pitfalls | references/parameterized.md |
| confirmation, async sequences, completion handlers | references/async-testing.md |
| @Suite, tags, parallel execution, .serialized | references/organization.md |
Review Checklist
- Expressions embedded directly in
(not pre-computed booleans)#expect -
used only for preconditions,#require
for assertions#expect - Error tests check specific types (not generic
)(any Error).self - Parameterized tests with pairs use
(not Cartesian product)zip() - No logic mirroring implementation in parameterized expected values
- Async sequences tested with
confirmation(expectedCount:) - Completion handlers use
, notwithCheckedContinuationconfirmation -
applied only where necessary (shared resources).serialized - Sibling serialized suites nested under parent if mutually exclusive
- No assumption of state persistence between
functions@Test - Disabled tests have explanations and bug links
When to Load References
- Reviewing #expect or #require usage -> expect-macro.md
- Reviewing @Test with arguments or traits -> parameterized.md
- Reviewing confirmation or async testing -> async-testing.md
- Reviewing @Suite or test organization -> organization.md
Review Questions
- Could pre-computed booleans in
lose diagnostic context?#expect - Is
stopping tests prematurely instead of revealing all failures?#require - Are multi-argument parameterized tests creating accidental Cartesian products?
- Could
silently drop test cases due to unequal array lengths?zip() - Are completion handlers incorrectly tested with
?confirmation