use super::client::ClientTest; #[cfg(test)] pub fn lines_should_not_contains(lines: Vec, str: &str) { for line in lines { if line.find(str).is_some() { eprintln!("'{}' found in '{}'", str, line); } assert!(line.find(str).is_none()); } } #[cfg(test)] pub fn status_should_be_empty(client: &mut ClientTest) { let (staged, not_staged) = client.get_status(); if staged.len() != 0 { eprintln!("id: {}", client.test_id.clone()); eprintln!("Staged should be empty but has '{}' line(s)", staged.len()); assert!(staged.len() == 0); } if staged.len() != 0 { eprintln!("id: {}", client.test_id.clone()); eprintln!("Not Staged should be empty but has '{}' line(s)", not_staged.len()); assert!(not_staged.len() == 0); } }