@ericcornelissen/arbitrary-bash
v0.1.2
Published
Generate arbitrary Bash commands with fast-check
Readme
arbitrary-bash
Generate arbitrary Bash commands with fast-check.
Installation
npm install fast-check @ericcornelissen/arbitrary-bashUsage
import * as assert from "node:assert";
import { test } from "node:test";
import * as fc from "fast-check";
import { bash } from "@ericcornelissen/arbitrary-bash";
test("arbitrary bash example", () => {
fc.assert(
fc.property(bash(), (command) => {
console.log(command);
assert.equal(typeof command, "string");
}),
);
});Inspiration
The following resources have been used to construct the Bash grammer used in this project.
- https://cmdse.github.io/pages/appendix/bash-grammar.html
- https://github.com/nfischer/shelljs-transpiler/blob/dc3e9c254c040adc1cc5bf6f01fdf3cf50065a10/src/bash.ohm
License
The source code is licensed under the Apache-2.0 license, see LICENSE for
the full license text.
