Typefully

Announcing PRBTest

Avatar

Share

 • 

4 years ago

 • 

View on X

1/ I'm excited to announce PRBTest! PRBTest is a modern collection of testing assertions for Solidity, meant to be a drop-in replacement for DSTest. Feature-packed, type-rich, with versioned releases, and designed to be used with Foundry. github.com/paulrberg/prb-test
2/ Feature-packed means lots of assertions. Booleans, equalities, inequalities, approximate equalities, numerical comparisons, and even array inclusions. Type-rich means overloads for `address`, `bytes`, `bytes32`, `int256`, `string` and `uint256`, and their array equivalents.
3/ So why choose PRBTest over DSTest? I wrote about this at length in the README. TL;DR 1. Missing features 2. No release versioning 3. Path dependence led to balkanization of DSTest forks 4. Lack of backwards compatibility with Node.js github.com/paulrberg/prb-test/tree/ce5d128391feb6f64dff05d8d4431c799646b2c5#why-choose-prbtest-over-dstest
4/ Refer to the GitHub repo for instructions on how to install PRBTest. It's meant to be used with Forge, but you can also use it in a Node.js environment like Hardhat. github.com/paulrberg/prb-test#install After you install it, here's how to use PRBTest:
5/ PRBTest remains compatible with all testing utilities from Forge Std, except for their "Test" contract. Though even that might change in the future - I have created a few PRs to make Forge Std more modular and more compatible with PRBTest.
6/ Just like my other projects PRBMath and PRBProxy, PRBTest is unapologetically available only in Solidity v0.8 It's time for the industry to move on. There's a long list of awesome features available exclusively in v0.8. docs.soliditylang.org/en/v0.8.0/080-breaking-changes.html
Avatar

Paul Razvan Berg

@PaulRBerg

Co-founder and CEO @Sablier. Open-source developer. I have a broad range of interests, including longevity, epistemology, physics, and psychology.