Skip to content

Commit 16570ef

Browse files
committed
cleanup tests (#301)
As also indicated by the git source, there is no special handling of backslashes on windows.
1 parent bc928f9 commit 16570ef

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

git-glob/tests/fixtures/make_baseline.sh

-14
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,3 @@ aBcDeFg abcdefg
155155
aBcDeFg ABCDEFG
156156
aBcDeFg AbCdEfG
157157
EOF
158-
159-
# nmatches OS specific
160-
# unix
161-
# "abc\\def" "abc/def"
162-
163-
164-
# windows only
165-
# abc[/]def "abc/def"
166-
# abc\def "abc/def"
167-
168-
# empty string is not a valid path-spec
169-
#** " "
170-
#{} " "
171-
#{,} " "

git-glob/tests/matching/mod.rs

+5-14
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,13 @@ fn compare_baseline_with_ours() {
4646
let dir = git_testtools::scripted_fixture_repo_read_only("make_baseline.sh").unwrap();
4747
let (mut total_matches, mut total_correct, mut panics) = (0, 0, 0);
4848
let mut mismatches = Vec::new();
49-
for (input_file, mut expected_matches, case, invert_expectation_on_other_os) in &[
50-
("git-baseline.match", true, pattern::Case::Sensitive, false),
51-
("git-baseline.nmatch", false, pattern::Case::Sensitive, false),
52-
("git-baseline.match-icase", true, pattern::Case::Fold, false),
53-
// (
54-
// "git-baseline-unix.match",
55-
// true,
56-
// pattern::Case::Sensitive,
57-
// if cfg!(unix) { false } else { true },
58-
// ),
49+
for (input_file, expected_matches, case) in &[
50+
("git-baseline.match", true, pattern::Case::Sensitive),
51+
("git-baseline.nmatch", false, pattern::Case::Sensitive),
52+
("git-baseline.match-icase", true, pattern::Case::Fold),
5953
] {
6054
let input = std::fs::read(dir.join(*input_file)).unwrap();
6155
let mut seen = BTreeSet::default();
62-
if *invert_expectation_on_other_os {
63-
expected_matches = !expected_matches;
64-
}
6556

6657
for m @ GitMatch {
6758
pattern,
@@ -72,7 +63,7 @@ fn compare_baseline_with_ours() {
7263
total_matches += 1;
7364
assert!(seen.insert(m), "duplicate match entry: {:?}", m);
7465
assert_eq!(
75-
is_match, expected_matches,
66+
is_match, *expected_matches,
7667
"baseline for matches must be {} - check baseline and git version: {:?}",
7768
expected_matches, m
7869
);

0 commit comments

Comments
 (0)