Stof Docs
Star on GitHubStof WebsiteDiscordContact Us
  • ๐Ÿš€Welcome
  • โ„น๏ธResources & Information
  • Book
    • Data Interface
    • Introduction & Design
    • Host Environments
      • Rust
      • TypeScript
        • Extend Stof
        • Import Statement
    • Data Interchange
      • JSON to Stof
      • Importing and Parsing Data
      • Exporting Data
      • REST and Restructure
    • Configuration Files
    • Schemas
      • Renaming Fields
      • Removing Fields
      • Validation & Transformation
        • Example Access
      • Nested Schemas
    • Orchestration
  • Common Concepts
    • Objects
    • Primitive Types
    • Functions
    • Fields
    • Object Types
    • Imports
    • Error Handling
    • Units
    • Casting/Conversions
  • Reference
    • CLI
      • ๐ŸƒRun
      • ๐ŸงชTest
      • ๐Ÿ“šCLI Libraries
        • Filesystem Library
        • Time Library
        • HTTP Library
    • Stof Language
    • Libraries
      • Standard Library
      • Array/Vector Library
      • Number Library
      • String Library
      • Object Library
      • Function Library
      • Set Library
      • Map Library
      • Data Library
      • Tuple Library
      • Blob Library
      • Boolean Library
    • ๐ŸชงFormats
Powered by GitBook
On this page
  • Options
  • Hello World

Was this helpful?

  1. Reference
  2. CLI

Test

Testing a Stof document with the CLI.

PreviousRunNextCLI Libraries

Last updated 3 months ago

Was this helpful?

If you haven't yet, install the 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".

      • http - Gives Stof an for making network calls.

      • github - Gives Stof access to via the GitHub API. A package manger will be released soon.

Hello World

file: hello.stof

#[test("hello world")]
fn hello(): str {
    return "hello world";
}
> stof test hello.stof
#[test("hello universe")]
fn hello(): str {
    return "hello world";
}
> stof test hello.stof
๐Ÿงช
stof-cli
HTTP interface
additional files hosted on GitHub
hello.stof test success output
hello.stof test failure output