Feat: Add test case covering empty string.

This commit is contained in:
Ian Rettig
2025-06-09 13:59:36 -04:00
parent 41a2027624
commit 28373951f4
+15
View File
@@ -28,3 +28,18 @@ fn find_content_in_file() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
#[test]
fn find_empty_string() -> Result<(), Box<dyn std::error::Error>> {
let file = assert_fs::NamedTempFile::new("sample.txt")?;
let content = "A test\nActual content\nMore content\nAnother test";
file.write_str(content)?;
let mut cmd = Command::cargo_bin("grrs")?;
cmd.arg("").arg(file.path());
cmd.assert()
.success()
.stdout(predicate::str::contains(content));
Ok(())
}