Skip to content

Clarify requiredness of the main method being on an object named Test #18078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2023
Merged
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
4 changes: 2 additions & 2 deletions docs/_docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ of the `tests/` directory. A small selection of test categories include:

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

### Naming and Running a Test Case

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

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