https://github.com/overdrivenpotato/loomy
https://github.com/overdrivenpotato/loomy
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/overdrivenpotato/loomy
- Owner: overdrivenpotato
- License: mit
- Created: 2022-02-09T23:19:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-10T00:25:22.000Z (over 4 years ago)
- Last Synced: 2025-03-06T21:41:53.940Z (about 1 year ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# `loomy`
[](https://crates.io/crates/loomy)
[][docs]
A shim crate to easily test code with `loom`.
```rust
// std or loom, chosen at compile time by crate feature.
use loomy::{thread, cell::UnsafeCell};
struct Foo {
cell: UnsafeCell<...>,
}
#[test]
fn test_example() {
// When using `std`, `loomy::model` only invokes the closure and nothing
// more.
loomy::model(|| {
// ...
thread::spawn(|| {
// ...
});
// ...
});
}
```
Run tests with `std`:
```sh
$ cargo test
```
Run tests with `loom`:
```sh
$ cargo test --features loomy/enable
```