Writing Automated Tests

In this chapter, we'll explore write tests to verify your code works correctly.

Writing Automated Tests

Testing is a complex skill. This chapter covers the mechanics of writing tests in Mana:

The Anatomy of a Test Function

A test in Mana is a function annotated with the #[test] attribute:

#[test]
fn it_works() -> void {
    let result = 2 + 2
    assert_eq(result, 4)
}

Run tests with:

mana test

Let's start with How to Write Tests.