Skip to content

Browse old issues and add regression tests when already fixed #3759

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

Closed
allanrenucci opened this issue Jan 5, 2018 · 0 comments
Closed

Browse old issues and add regression tests when already fixed #3759

allanrenucci opened this issue Jan 5, 2018 · 0 comments

Comments

@allanrenucci
Copy link
Contributor

A very easy way to start contributing to Dotty and experiment with the compiler is to browse our issue tracker looking for issues that have already been fixed. The older the issue, the more likely it is already fixed 😄 .

Once such an issue is found, you need to create a regression test for it. Name your test according to the issue fixed (e.g. i3585.scala for #3585). We write tests within the tests directory:

.
└── tests
    ├── neg
    ├── pos
    └── run

Negative test

A test case that shouldn't compile should be put in tests/neg. When writing a negative test, you must add a // error comment next to the line that produces a compilation error. For example:

class Foo {
  noFound // error
}

Positive test

If a test case is expected to compile, simply add it to tests/pos.

Run test

A test that must be run, should be put in tests/run. Such a test must have an object named Test with a main method. For example:

object Test {
  def main(args: Array[String]): Unit = {
    assert(1 + 1 == 2)
  }
}

You can find information on how to run a test in the documentation.

You can now submit a PR! Make sure your commit message references the issue fixed (e.g. Fix #3586: Add regression test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants