//use log_analysis; #[test] fn test_new() { //let date_dir = "zeek-test-logs/2024-07-02"; //let log_type = "conn"; //let start_time = "00:00:00"; //let end_time = "01:00:00"; //let log_gz = "log.gz"; //let header = format!("{}/{}.{}-{}.{}",date_dir, log_type, start_time, end_time, log_gz); //let date_dir = std::path::Path::new(&header); //let header = LogHeader::new(&date_dir); //assert!(header.separator.is_whitespace()); //assert!(header.set_separator.len() > 0); //assert!(header.empty_field.len() > 0); //assert!(header.unset_field.len() > 0); //assert!(header.path.len() > 0); //assert!(header.open.len() > 0); //assert!(header.fields.len() > 0); //assert!(header.types.len() > 0); //println!("{header:?}"); } #[test] fn test_add_field_entry() { //let date_dir = "zeek-test-logs/2024-07-02"; //let log_type = "dns"; //let start_time = "00:00:00"; //let end_time = "01:00:00"; //let log_gz = "log.gz"; //let header = format!("{}/{}.{}-{}.{}",date_dir, log_type, start_time, end_time, log_gz); //let date_dir = std::path::Path::new(&header); //let h = LogHeader::new(&date_dir); //let mut log : LogData = LogData::new(&h); //log.add_field_entry("test123","one"); //log.add_field_entry("test123","two"); //log.add_field_entry("test123","three"); //log.add_field_entry("test1","one"); //assert_eq!(log.data.get("test123").unwrap(), &vec!["one","two","three"]); //println!("passed: {:?}",log.data.get("test123").unwrap()); //assert_eq!(log.data.get("test1").unwrap(), &vec!["one"]); //println!("passed: {:?}",log.data.get("test1").unwrap()); }