Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ result, err := parser.EvalExpressions(envStruct)
- **System**: `execute`, `delay`, `evaluate`, `stop`, `echo`
- **MiSTer**: `mister.ini`, `mister.core`, `mister.script`, `mister.mgl`
- **HTTP**: `http.get`, `http.post`
- **Input**: `input.keyboard`, `input.gamepad`, `input.coinp1`, `input.coinp2`
- **Input**: `input.keyboard`, `input.gamepad`, `input.coinp1`, `input.coinp2`, `input.coinp3`, `input.coinp4`
- **UI**: `ui.notice`, `ui.picker`
- **Metadata**: `traits` (parsed from `#key=value` syntax)

Expand Down
2 changes: 2 additions & 0 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ const (
ZapScriptCmdInputGamepad = "input.gamepad"
ZapScriptCmdInputCoinP1 = "input.coinp1"
ZapScriptCmdInputCoinP2 = "input.coinp2"
ZapScriptCmdInputCoinP3 = "input.coinp3"
ZapScriptCmdInputCoinP4 = "input.coinp4"
Comment on lines +59 to +60
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add tests for the new input command constants.

These new public command values should be covered by tests (at least parser acceptance / model round-trip) so support for input.coinp3 and input.coinp4 doesn’t regress silently.

As per coding guidelines: “Do not skip writing tests for new features or bug fixes” and “Write tests for all new code with comprehensive coverage required.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@models.go` around lines 59 - 60, The new public constants
ZapScriptCmdInputCoinP3 and ZapScriptCmdInputCoinP4 lack unit tests; add tests
that parse/serialize these command strings and assert round-trip equality and
parser acceptance (e.g., a test that feeds "input.coinp3" and "input.coinp4"
into the existing parser and verifies the produced model uses the corresponding
constant and that serializing the model yields the same command string), include
negative/edge cases if your parser supports variations, and place tests
alongside existing model/parser tests so future changes to
ZapScriptCmdInputCoinP3 and ZapScriptCmdInputCoinP4 will be caught.


ZapScriptCmdUINotice = "ui.notice"
ZapScriptCmdUIPicker = "ui.picker"
Expand Down