leekscript-rs 0.1.0

LeekScript parser, formatter, and semantic analysis in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Shared helpers for integration tests.

use std::path::Path;

/// Read a fixture file from `tests/fixtures/<name>`.
pub fn read_fixture(name: &str) -> String {
    let path = Path::new(env!("CARGO_MANIFEST_DIR"))
        .join("tests/fixtures")
        .join(name);
    std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("read {}: {}", path.display(), e))
}