E1144: test verb in a production source file

View source

A meta test verb belongs in a tests directory (ADR-0121).

A meta test verb belongs in a tests directory (ADR-0121). A module's tests live in src/<module>/tests/, and the tests of the project live in tests/. A meta test verb in any other source file is an error, so production files never carry test code. For the root unit the message adds that it has no tests directory. Move its logic into a module, or test it from tests/ through what it opens.

Example

actus
import math;

verb main() {
}
actus
open add;
actus
open verb add(abs left: Int, abs right: Int) -> Int {
    return left + right;
}

meta test
verb adds() -> Int {
    return 0;
}

Fix

Move the test into the tests directory of the module.

actus
import math;

verb main() {
}
actus
open add;
actus
open verb add(abs left: Int, abs right: Int) -> Int {
    return left + right;
}
actus
meta test
verb adds() -> Int {
    return 0;
}

Run actus explain E1144 in your terminal to read this entry offline. Browse Modules & rules or all error codes.