Skip to content
← Index | Lesson 2 of 4

@test

@test — Inline tests

@test marks a function as a test:

@test
fn test_sum() {
    assert_eq(1 + 1, 2)
    assert_eq(10 - 3, 7)
    assert_ne(5, 6)
}

Run with zolo test file.zolo.

Goal: Write an add function and a @test for it.

lesson-7-2.zolo
Program output

Run the code to see the output

Search Zolo

9 results

enespt-br