2023-04-19 02:38:18 +00:00
|
|
|
#[test]
|
2023-08-21 04:14:10 +00:00
|
|
|
fn {name}() {{
|
2023-04-19 02:38:18 +00:00
|
|
|
let todo_org_path = "{path}";
|
|
|
|
let org_contents = std::fs::read_to_string(todo_org_path).expect("Read org file.");
|
2023-04-19 03:57:57 +00:00
|
|
|
println!("{{}}", org_contents);
|
2023-09-02 16:15:57 +00:00
|
|
|
let org_sexp = emacs_parse_anonymous_org_document(org_contents.as_str()).expect("Use emacs to parse org file.");
|
2023-04-19 02:38:18 +00:00
|
|
|
println!("{{}}", org_sexp);
|
2023-04-22 00:53:55 +00:00
|
|
|
let (_remaining, parsed_sexp) = sexp_with_padding(org_sexp.as_str()).expect("Sexp Parse failure");
|
2023-09-03 19:44:18 +00:00
|
|
|
let rust_parsed = parse(org_contents.as_str()).expect("Org Parse failure");
|
2023-04-19 02:38:18 +00:00
|
|
|
println!("{{:#?}}", rust_parsed);
|
|
|
|
let diff_result =
|
|
|
|
compare_document(&parsed_sexp, &rust_parsed).expect("Compare parsed documents.");
|
|
|
|
diff_result
|
2023-08-29 19:10:27 +00:00
|
|
|
.print(org_contents.as_str())
|
2023-04-19 02:38:18 +00:00
|
|
|
.expect("Print document parse tree diff.");
|
|
|
|
assert!(!diff_result.is_bad());
|
|
|
|
}}
|