🧪Test

Testing a Stof document with the CLI.

If you haven't yet, install the stof-cli binary. More instructions can be found on the Resources & Information page.

> stof test <OPTIONS> <FILE>.stof

Options

  • -a, --allow <ALLOW>

    • Add an additional library to use by name. By default, the CLI gives access to read and write files on the system (for imports), but nothing else. If for example you want to give Stof access to the network, you'll need to pass "-a http".

Hello World

file: hello.stof

#[test("hello world")]
fn hello(): str {
    return "hello world";
}
> stof test hello.stof
hello.stof test success output
#[test("hello universe")]
fn hello(): str {
    return "hello world";
}
> stof test hello.stof
hello.stof test failure output

Last updated

Was this helpful?