organic/tests/test_template
Tom Alexander 8561fdc1bd
All checks were successful
rustfmt Build rustfmt has succeeded
rust-test Build rust-test has succeeded
rust-build Build rust-build has succeeded
Make the autogen prefix fully integrated into the test name.
2023-08-21 00:14:10 -04:00

19 lines
824 B
Plaintext

#[test]
fn {name}() {{
let todo_org_path = "{path}";
let org_contents = std::fs::read_to_string(todo_org_path).expect("Read org file.");
println!("{{}}", org_contents);
let org_sexp = emacs_parse_org_document(org_contents.as_str()).expect("Use emacs to parse org file.");
println!("{{}}", org_sexp);
let (_remaining, parsed_sexp) = sexp_with_padding(org_sexp.as_str()).expect("Sexp Parse failure");
let (remaining, rust_parsed) = document(org_contents.as_str()).expect("Org Parse failure");
println!("{{:#?}}", rust_parsed);
let diff_result =
compare_document(&parsed_sexp, &rust_parsed).expect("Compare parsed documents.");
diff_result
.print()
.expect("Print document parse tree diff.");
assert!(!diff_result.is_bad());
assert_eq!(remaining, "");
}}