# Testing

## Standard gates

```sh
moon check --target all --deny-warn
moon test --target all --deny-warn
moon fmt --check
moon info
```

Native integration gates:

```sh
moon run examples/library-demo
moon run --target native cmd/moon-http-cache -- analyze examples/scenarios/fresh-hit.json
moon run --target native cmd/moon-http-cache -- analyze examples/scenarios/stale-revalidate.json --format json
```

## Coverage strategy

Tests cover normal, boundary, malformed, overflow, cache-mode, authorization,
Vary, stale, validation, 304 merge, invalidation, and RFC 5861 paths. Every
terminal public decision has a stable reason-code assertion. Scenario render
tests parse generated JSON to keep the machine contract valid.

The CI matrix runs Linux, macOS, and Windows. Portable check and test commands use
all MoonBit backends; native-only CLI smoke tests run separately.

