Skip to content

Commit cd6d4cc

Browse files
author
Valentin Vetter
committed
docs(runner): document YAML testcases
1 parent 45dd738 commit cd6d4cc

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

playground/core-concepts/core-4-configuration.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Optionally, you can tranlate your popups in French using `welcome_fr.html` files
239239

240240
You will need to create test case files to run your **Solo** game.
241241

242-
Your test cases must be named `test<number>.json` and placed in the `config` directory. Their `<number>` determine the order they will be listed in the CodinGame IDE. Here is an example:
242+
Your test cases must be named `test<number>.json` or `test<number>.yaml` and placed in the `config` directory. Their `<number>` determine the order they will be listed in the CodinGame IDE. Here is an example:
243243

244244
`test1.json`
245245
```json
@@ -253,6 +253,22 @@ Your test cases must be named `test<number>.json` and placed in the `config` dir
253253
"isValidator": "false"
254254
}
255255
```
256+
257+
or the YAML equivalent:
258+
259+
`test1.yaml`
260+
```yaml
261+
title:
262+
2: One path
263+
1: Un seul chemin
264+
testIn: |-
265+
.o...
266+
.ooo.
267+
...o.
268+
isTest: 'true'
269+
isValidator: 'false'
270+
```
271+
256272
- **title:**
257273
- **2:** English title, this parameter is mandatory.
258274
- **1:** French title, optional.

runner/src/main/java/com/codingame/gameengine/runner/SoloGameRunner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private TestCase parseTestCaseFile(File file) throws JsonSyntaxException, IOExce
6464
* The file path must be relative considering the root directory is <b>config</b>.
6565
*
6666
* @param testCaseFileName
67-
* the test case file path
67+
* the test case file path (JSON or YAML)
6868
*/
6969
public void setTestCase(String testCaseFileName) {
7070
setTestCase(new File(System.getProperty("user.dir")).toPath().resolve("config/" + testCaseFileName).toFile());
@@ -74,7 +74,7 @@ public void setTestCase(String testCaseFileName) {
7474
* Sets a test case file which <b>testIn</b> value will be sent to the Game Manager as a test case input.
7575
*
7676
* @param testCaseFile
77-
* the test case file
77+
* the test case file (JSON or YAML)
7878
*/
7979
public void setTestCase(File testCaseFile) {
8080
if (testCaseFile == null) {

0 commit comments

Comments
 (0)