mod automerge_paper_helpers; use automerge_paper_helpers::{load_automerge_paper_from_json, load_automerge_paper_result}; #[test] fn test_automerge_paper() { let (base_doc, _, ops) = load_automerge_paper_from_json(false); let root = base_doc.with_ops_applied(&ops).get_root(); let arr = root.if_list().unwrap().val(); let target_txt = load_automerge_paper_result(); let jmbl_txt = arr .iter() .map(|elem| elem.if_plain().unwrap().as_str().unwrap()) .collect::(); std::fs::write("../../target/jmbl.txt", jmbl_txt.as_bytes()).unwrap(); // since the automerge ops have opposite behaviour with regards to concurrent descendants, we only check if the length are equal assert_eq!(target_txt.len(), jmbl_txt.len()); // assert!( // target_txt == jmbl_txt, // "not equal, lengths {} vs {}", // target_txt.len(), // jmbl_txt.len() // ) }