A simple, fast, and easy to use Solidity test generator based on the Branching Tree Technique.

Overview

bulloak

A simple, fast, and easy to use Solidity test generator based on the Branching Tree Technique.

Installing

cargo install bulloak

Usage

Basic Usage

Say you have a foo.tree file with the following contents:

foo.sol
 └── when stuff called
    └── it should revert

If you pass it to bulloak like so, you will get the skeleton of a test contract printed to stdout:

$ bulloak foo.tree
pragma solidity [VERSION];

contract FooTest {
  modifier whenStuffCalled() {
    _;
  }

  function testRevertsWhenStuffCalled()
    external
    whenStuffCalled
  {
    // it should revert
  }
}

Scaffold Multiple Trees

If you are working in a solidity project and you have multiple trees you want to scaffold, you can use the -w option.

$ bulloak -w ./**/*.tree

This will create solidity files with the same name as the .tree files with the result of scaffolding each tree.

Options

Usage: bulloak [OPTIONS] [FILES]...

Arguments:
  [FILES]...  .tree files to process

Options:
  -c                 Whether to print `it` branches as comments in the output code
  -i <INDENT>        The indentation of the output code [default: 2]
  -w, --write-files  Whether to write to files instead of stdout
  -h, --help         Print help (see more with '--help')
  -V, --version      Print version

Compiler Errors

Another feature of bulloak is reporting errors in your input trees.

For example, say you have a buggy foo.tree file, which is missing a character. Running bulloak foo.tree would report the error like this:

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
bulloak error: unexpected `when` keyword

── when the id references a null stream
   ^^^^

--- (line 2, column 4) ---
file: foo.tree

Contributing

Please refer to CONTRIBUTING.md.

Inspired By

bulloak is heavily inspired by BurntSushi's regex crate.

License

This project is licensed under either of:

You might also like...
Simple test app based on rust-psp

PSP Test App Simple test app based on rust-psp. Demonstrating the usage of C libs. Build Download and unzip the prebuilt PSPSDK (built from clang-psp)

A simple cross-platform easy to use STL Viewer with GUI and CLI options
A simple cross-platform easy to use STL Viewer with GUI and CLI options

Stlvi STL viewer written in Rust. This project is still in development. It is available in both CLI and GUI mode. Supported OS Linux Windows Mac Scree

An easy-to-use TUI crate for Rust, based off of the Elm architecture.

Rustea An easy-to-use TUI crate for Rust, based off of the Elm architecture. This is a re-implementation of Go's Tea, created by TJ Holowaychuk. Featu

Rustato: A powerful, thread-safe global state management library for Rust applications, offering type-safe, reactive state handling with an easy-to-use macro-based API.
Rustato: A powerful, thread-safe global state management library for Rust applications, offering type-safe, reactive state handling with an easy-to-use macro-based API.

Rustato State Manager A generical thread-safe global state manager for Rust Introduction • Features • Installation • Usage • Advanced Usage • Api Refe

rehype plugin to use tree-sitter to highlight code in pre code blocks

rehype-tree-sitter rehype plugin to use tree-sitter to highlight code in precode blocks Contents What is this? When should I use this? Install Use

A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Blazingly fast interpolated LUT generator and applicator for arbitrary and popular color palettes.
Blazingly fast interpolated LUT generator and applicator for arbitrary and popular color palettes.

lutgen-rs A blazingly fast interpolated LUT generator and applicator for arbitrary and popular color palettes. Theme any image to your dekstop colorsc

Over-simplified, featherweight, open-source and easy-to-use authentication and authorization server.

concess ⚠️ Early Development: This is not production ready, yet. Do not use it for anything important. Introduction concess is a over-simplified, feat

Nodium is an easy-to-use data analysis and automation platform built using Rust, designed to be versatile and modular.
Nodium is an easy-to-use data analysis and automation platform built using Rust, designed to be versatile and modular.

Nodium is an easy-to-use data analysis and automation platform built using Rust, designed to be versatile and modular. Nodium aims to provide a user-friendly visual node-based interface for various tasks.

Owner
Alexander González
alexfertel.eth
Alexander González
Simple grammar-based test case generator

tree-splicer tree-splicer is a simple grammar-based test case generator. It parses a number of input files using tree-sitter grammars, and produces ne

Langston Barrett 5 Mar 19, 2023
A simple, fast, and easy to use static file server

Warning This is still in early development, I would not recommend for production use.. yet. See the issues for things that are on the "roadmap" or mis

Ayodeji O. 5 Feb 26, 2024
Coppers is a custom test harnass for Rust that measures the energy usage of your test suite.

Coppers Coppers is a test harness for Rust that can measure the evolution of power consumptions of a Rust program between different versions with the

Thijs Raymakers 175 Dec 4, 2022
Count your code by tokens, types of syntax tree nodes, and patterns in the syntax tree. A tokei/scc/cloc alternative.

tcount (pronounced "tee-count") Count your code by tokens, types of syntax tree nodes, and patterns in the syntax tree. Quick Start Simply run tcount

Adam P. Regasz-Rethy 48 Dec 7, 2022
Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface

tree-sitter-traversal Traversal of tree-sitter Trees and any arbitrary tree with a TreeCursor-like interface. Using cursors, iteration over the tree c

Sebastian Mendez 12 Jan 8, 2023
As-tree - Print a list of paths as a tree of paths 🌳

as-tree Print a list of paths as a tree of paths. For example, given: dir1/foo.txt dir1/bar.txt dir2/qux.txt it will print: . ├── dir1 │ ├── foo.tx

Jake Zimmerman 396 Dec 10, 2022
AI-Boosted Solidity REPL

ChiselGPT: AI-Boosted Solidity REPL Chisel-GPT is an extension for Chisel allowing natural language requests. The natural language requests are conver

null 74 Apr 19, 2023
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!

uwuifyy A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text! Logo Credits: Jade Nelson Tab

Hamothy 43 Dec 12, 2022
🚀 A blazingly fast easy to use dotfile and global theme manager written in Rust

GTHEME A blazingly fast easy to use dotfile and global theme manager for *NIX systems written in Rust ?? Demo using wip desktop. To check out more des

David Rodriguez 19 Nov 28, 2022
A blazing fast and easy to use TRPC-like server for Rust.

rspc ?? Work in progress ?? A blazing fast and easy to use TRPC-like server for Rust. Website Example You define a trpc router and attach resolvers to

Oscar Beaumont 344 Dec 31, 2022