Write project tests

moon test directory discovers fn test_* suites; they need no main. Use std.testing assertions and --filter text to select one suite or test while iterating.

Keep each test about one property, even when that property needs several assertions. A failing assertion names the test and stops that test with a useful diagnostic.

use std.testing.{assert_eq, assert_true}

fn double(value: int) -> int { value * 2 }

fn test_double() {
  assert_eq(double(4), 8)
  assert_true(double(-2) < 0)
}
Run locally
moon test .
Ctrl/⌘+Enter checks the current lesson.