Skip to content

Write the input-through-prompt suite in the YAML DSL - #67

Merged
TomNaessens merged 1 commit into
masterfrom
enhancement/9723-dsl-before-after
Nov 6, 2026
Merged

TomNaessens merged 1 commit into
masterfrom
enhancement/9723-dsl-before-after

Conversation

@TomNaessens

@TomNaessens TomNaessens commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The tested/javascript/input-through-prompt suite was JSON only because the DSL had no context before. It does since dodona-edu/universal-judge#924, so the suite is now suite.yaml, with the same 3 contexts, the same prompt() shim and the same expected output. The README describes the YAML version.

Part of the Courses box in https://github.com/dodona-edu/dodona/issues/9723.

One difference: the DSL always adds a trailing newline to string stdin. The program now gets World\n where the JSON suite gave World, and the stdin in the testcase description gets that newline too. The shim calls .trim() before it splits, so prompt() returns the same value and the outcome stays the same.

Manual testing

  1. Check out enhancement/9723-dsl-before-after.
  2. Open tested/javascript/input-through-prompt/evaluation/suite.yaml. Each context's before points at the shim, defined once under definitions (a YAML anchor) and unchanged from the old suite.json.
  3. Run the judge with the reference solution: docker run --rm --platform linux/amd64 -v <universal-judge at master>:/judge -v $PWD/tested/javascript/input-through-prompt:/exercise ghcr.io/dodona-edu/dodona-tested bash -c "cd /judge && python3 -m tested.cli -e /exercise -p javascript -t /exercise/evaluation/suite.yaml -f". All 3 tests are correct.
  4. Edge case: change the solution to print "Hi, " + name. All 3 tests are wrong.
Verification

Judge: universal-judge master at 785879e1 (merge of #924), in ghcr.io/dodona-edu/dodona-tested:latest.

dodona-authoring verify procedure on the YAML suite:

  • DSL validation: ok
  • Reference solution: 3 correct
  • Trivially wrong solution (// wrong): 3 wrong

JSON against YAML, normalized judge output (one line per output command), diffed:

  • Reference solution: identical except the three testcase descriptions (World vs World\n, same for Dodona and Alice). Same statuses (3 correct) and the same expected and generated stdout.
  • Wrong solution (Hi, + name): same differences only. Both give 3 wrong.
  • The shim string TESTed receives is byte-identical to the JSON data (|- block, no trailing newline).

🤖 Generated with Claude Code

@TomNaessens TomNaessens added the enhancement New feature or request label Nov 5, 2026
@TomNaessens TomNaessens self-assigned this Nov 5, 2026
The DSL now has context-level before/after (universal-judge#924), so the
prompt() shim no longer forces a JSON suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TomNaessens
TomNaessens force-pushed the enhancement/9723-dsl-before-after branch from df2de02 to 53a24ef Compare November 5, 2026 16:46
@TomNaessens
TomNaessens marked this pull request as ready for review November 6, 2026 10:05
@TomNaessens
TomNaessens enabled auto-merge November 6, 2026 10:05
@TomNaessens
TomNaessens merged commit 537908d into master Nov 6, 2026
11 checks passed
@TomNaessens
TomNaessens deleted the enhancement/9723-dsl-before-after branch November 6, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants