Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodesdev committed Jun 7, 2024
1 parent d7e6fed commit e4436a7
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions crates/syntest/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Syntest

Syntest is a simple Rust library with helper functions to help evaluate Rust code.
Syntest is a small crate that is used to test the rustfinity challenges not just by output and behavior but also by the syntax of the code.

It's used to evaluate user provided code snippets in the [rustfinity challenges](https://rustfinity.com/practice/rust/challenges)
## Usage

```rust
use syntest::Syntest;

#[test]
fn test_syntax() {
// opens the file and reads the code
let syntest = Syntest::from("./src/main.rs");

// gets all the local variables inside a function
let variables = syntest.variables("main");

// Checks if all of the variables are used
variables.iter().for_each(|variable| {
assert!(variable.is_used());
});
}
```

0 comments on commit e4436a7

Please sign in to comment.