Skip to content

Commit e61b419

Browse files
committed
Improve sensitivity of last two integration tests
Those tests were only checking that the output was nonempty, so they would pretty much never detect anything fishy. We could go further but it's nontrivial because the output is nondeterministic (because of temporary files) and it's unclear if we want to build complex regexes in the test suite right now. In the meantime, here's a basic improvement.
1 parent 762e724 commit e61b419

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/integration.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,16 +758,17 @@ fn test_date_custom_format_supports_padding() {
758758
#[test]
759759
fn test_all_directory() {
760760
let dir = tempdir();
761-
dir.child("one").touch().unwrap();
762-
dir.child("two").touch().unwrap();
761+
dir.child("subdir-one").touch().unwrap();
762+
dir.child("subdir-two").touch().unwrap();
763763

764764
cmd()
765765
.arg("-a")
766766
.arg("-d")
767767
.arg("--ignore-config")
768768
.arg(dir.path())
769769
.assert()
770-
.stdout(predicate::str::is_match(".").unwrap());
770+
.stdout(predicate::str::contains("subdir-one").not())
771+
.stdout(predicate::str::contains("subdir-two").not());
771772
}
772773

773774
#[test]
@@ -777,8 +778,10 @@ fn test_multiple_files() {
777778
dir.child("two").touch().unwrap();
778779

779780
cmd()
781+
.arg("--ignore-config")
780782
.arg(dir.path().join("one"))
781783
.arg(dir.path().join("two"))
782784
.assert()
783-
.stdout(predicate::str::is_match(".").unwrap());
785+
.stdout(predicate::str::is_match("one").unwrap().count(1))
786+
.stdout(predicate::str::is_match("two").unwrap().count(1));
784787
}

0 commit comments

Comments
 (0)