https://github.com/atomicptr/buster
A tiny, single file, header only assertion library for C++23
https://github.com/atomicptr/buster
assertions cpp cpp-library cpp23 unit-testing
Last synced: 6 months ago
JSON representation
A tiny, single file, header only assertion library for C++23
- Host: GitHub
- URL: https://github.com/atomicptr/buster
- Owner: atomicptr
- License: 0bsd
- Created: 2025-01-13T18:42:07.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-26T18:16:08.000Z (about 1 year ago)
- Last Synced: 2025-07-22T02:00:35.983Z (6 months ago)
- Topics: assertions, cpp, cpp-library, cpp23, unit-testing
- Language: C++
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# buster
A tiny, single file, header only assertion library for C++23
## Usage
The general idea of this library is to give you a way to write tests in any way you see fit, so it's
not really doing anything but giving you assertion functions.
One way to use buster, which is how I like to do tests these days:
- Make a tests directory, add the [src/buster.hpp](src/buster.hpp) and start adding your tests
- Create a new .cpp file for every test case
- Write a script that builds all of them and then executes them
Example for one test case:
```cpp
#include "buster.hpp"
// the function we're going to test
int adder(int a, int b) {
return a + b;
}
int main() {
expect_equals(4, adder(2, 2));
expect_true(adder(2, 3) == 5);
return 0;
}
```
## License
BSD 0-Clause