drawlang 0.1.2

Precision diagrams as code — a DSL and renderer built for AI-agent authors
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// The cheat sheet exists twice: embedded in the binary (so agents with only
/// the binary can read it via `drawlang cheatsheet`) and in the repo as
/// docs/CHEATSHEET.md (so it's browsable on GitHub). This test stops drift.
#[test]
fn embedded_guide_matches_repo_cheatsheet() {
    let embedded = include_str!("../src/cheatsheet.md");
    let repo_path = format!("{}/../../docs/CHEATSHEET.md", env!("CARGO_MANIFEST_DIR"));
    // The docs/ tree isn't shipped in the published crate; skip there.
    let Ok(repo) = std::fs::read_to_string(&repo_path) else {
        return;
    };
    assert_eq!(
        embedded, repo,
        "crates/drawlang/src/cheatsheet.md and docs/CHEATSHEET.md have drifted; \
         copy one over the other"
    );
}