Skip to content

Commit

Permalink
test(frontmatter-gen): ✅ Add new unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed Nov 23, 2024
1 parent 750f6c0 commit 51797cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ A high-performance Rust library for parsing and serialising frontmatter in YAML,

## Key Features 🎯

- **Zero-Copy Parsing**: Parse YAML, TOML, and JSON frontmatter efficiently with zero memory copying
- **Safe Extraction**: Extract frontmatter using standard delimiters (`---` for YAML, `+++` for TOML) with comprehensive error handling
- **Type Safety**: Leverage Rust's type system with the `Value` enum for safe frontmatter manipulation
- **High Performance**: Optimised for speed with minimal allocations and efficient algorithms
- **Memory Safety**: Guaranteed memory safety through Rust's ownership system
- **Rich Error Handling**: Detailed error types with context for effective debugging
- **Async Support**: First-class asynchronous operation support
- **Flexible Configuration**: Customisable parsing behaviour to match your needs
- **Zero-copy parsing** for optimal memory efficiency
- **Multi-format support** (YAML, TOML, JSON)
- **Type-safe operations** with comprehensive error handling
- **Secure processing** with input validation and size limits
- **Async support** with the `ssg` feature flag
- **Command-line interface** for direct manipulation

## Available Features 🛠️

Expand Down Expand Up @@ -72,15 +70,9 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
# Core library with command-line interface and SSG support
frontmatter-gen = { version = "0.0.4", features = ["cli", "ssg"] }

# Basic functionality
frontmatter-gen = "0.0.4"

# With CLI support
frontmatter-gen = { version = "0.0.4", features = ["cli"] }

# All features (CLI and SSG)
frontmatter-gen = { version = "0.0.4", features = ["ssg"] }
```

## Basic Usage 🔨
Expand Down
6 changes: 3 additions & 3 deletions src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ mod tests {

let templates = engine.template_cache.read().await;
assert_eq!(
templates.items.get("default"),
Some(&template_content.to_string())
);
templates.items.get("default"),
Some(&template_content.to_string())
);

temp_dir.close()?;
Ok(())
Expand Down

0 comments on commit 51797cf

Please sign in to comment.