use nodl; use nodl::Note; use std::collections::{BTreeMap, HashMap}; use std::fs::File; use std::io::Read; use std::path::Path; #[test] fn test_build_graph() { let path = Path::new("fixtures/notes"); let built_note_map = nodl::run(path); let mut links_file = File::open("fixtures/links.json").unwrap(); let mut data = String::new(); links_file.read_to_string(&mut data).unwrap(); let true_note_map: HashMap = serde_json::from_str(&data).unwrap(); let true_note_map_bt: BTreeMap<_, _> = true_note_map.iter().collect(); let built_note_map_bt: BTreeMap<_, _> = built_note_map.iter().collect(); assert!(built_note_map_bt.eq(&true_note_map_bt)); }