use std::fs;
use std::path::Path;
#[test]
fn the_embedded_grammar_is_the_file_on_disk() {
let root = Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.expect("rs/ has a parent");
let on_disk = fs::read_to_string(root.join("csv-grammar.jsonic"))
.expect("csv-grammar.jsonic is readable at the repository root");
let embedded = tabnas_csv::grammar_text();
assert_eq!(
embedded.strip_prefix('\n').unwrap_or(embedded),
on_disk,
"rs/src/lib.rs GRAMMAR_TEXT differs from csv-grammar.jsonic: run `node ts/embed-grammar.js`"
);
}
#[test]
fn the_grammar_text_fits_the_raw_string() {
assert!(!tabnas_csv::grammar_text().contains("\"##"));
}