Skip to content

Commit b08d227

Browse files
SporarumKordyjan
authored andcommitted
Clarify requiredness of the main method being on an object named Test
[Cherry-picked 970608a]
1 parent a6a8613 commit b08d227

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/_docs/contributing/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ of the `tests/` directory. A small selection of test categories include:
4040

4141
- `tests/pos` – tests that should compile: pass if compiles successfully.
4242
- `tests/neg` – should not compile: pass if fails compilation. Useful, e.g., to test an expected compiler error.
43-
- `tests/run` – these tests not only compile but are also run.
43+
- `tests/run` – these tests not only compile but are also run. Must include at least a `@main def Test = ...`.
4444

4545
### Naming and Running a Test Case
4646

@@ -80,7 +80,7 @@ in a single run, this is called *joint compilation*. In this case use file names
8080
### Checking Program Output
8181

8282
`tests/run` tests verify the run-time behaviour of a test case. The output is checked by invoking a main method
83-
on a class `Test`, this can be done with either
83+
on a class `Test` (which is required to exist even if there is no checkfile), this can be done with either
8484
```scala
8585
@main def Test: Unit = assert(1 > 0)
8686
```

0 commit comments

Comments
 (0)