Skip to content

Commit b450825

Browse files
committed
improve coverage
1 parent ea1a7c3 commit b450825

File tree

9 files changed

+159
-10
lines changed

9 files changed

+159
-10
lines changed

Cargo.lock

Lines changed: 143 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ argmax = "0.3.1"
2222
itertools = "0.14.0"
2323
quick-error = "2.0.1"
2424
uutests = "0.0.30"
25+
rstest = "0.25.0"
2526

2627
[dev-dependencies]
2728
assert_cmd = "2"

test_data/db/abc def

Whitespace-only changes.

test_data/db/abc def

Whitespace-only changes.

test_data/db/depth/1234567890123456789012345678901234567890/1234567890123456789012345678901234567890/1234567890123456789012345678901234567890/1234567890123456789012345678901234567890/f0

Whitespace-only changes.

test_data/db/depth/1234567890123456789012345678901234567890/1234567890123456789012345678901234567890/1234567890123456789012345678901234567890/1234567890123456789012345678901234567890/f1

Whitespace-only changes.

test_data/db/✨sparkles✨

Whitespace-only changes.

test_data_db

42 Bytes
Binary file not shown.

tests/db_tests.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mod common;
99
use std::process::Command;
1010

1111
use assert_cmd::{assert::OutputAssertExt, cargo::CommandCargoExt};
12+
use rstest::rstest;
1213

1314
use crate::common::test_helpers::fix_up_slashes;
1415

@@ -85,12 +86,21 @@ fn test_locate_statistics() {
8586
.success();
8687
}
8788

88-
#[test]
89+
#[rstest]
90+
#[case("emacs")]
91+
#[case("grep")]
92+
#[case("posix-basic")]
93+
#[case("posix-extended")]
8994
#[cfg(not(windows))]
90-
fn test_locate_regex() {
95+
fn test_locate_regex(#[case] input: &str) {
9196
Command::cargo_bin("locate")
9297
.expect("couldn't find locate binary")
93-
.args(["abbbc", "--regex", DB_FLAG])
98+
.args([
99+
"abbbc",
100+
"--regex",
101+
format!("--regextype={input}").as_str(),
102+
DB_FLAG,
103+
])
94104
.assert()
95105
.success();
96106
}
@@ -100,7 +110,7 @@ fn test_locate_regex() {
100110
fn test_locate_all() {
101111
Command::cargo_bin("locate")
102112
.expect("couldn't find locate binary")
103-
.args(["abb", "bbc", "--regex", DB_FLAG])
113+
.args(["abb", "bbc", "--all", DB_FLAG])
104114
.assert()
105115
.success();
106116
}
@@ -110,7 +120,7 @@ fn test_locate_all() {
110120
fn test_locate_all_regex() {
111121
Command::cargo_bin("locate")
112122
.expect("couldn't find locate binary")
113-
.args(["abb", "b*c", "--regex", DB_FLAG])
123+
.args(["abb", "b*c", "--all", "--regex", DB_FLAG])
114124
.assert()
115125
.success();
116126
}

0 commit comments

Comments
 (0)